Skip to content

feat(CodeMigrations): Adding migrations in command at dockerfile #4

feat(CodeMigrations): Adding migrations in command at dockerfile

feat(CodeMigrations): Adding migrations in command at dockerfile #4

name: Production-Pipeline-SWR-CCI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CLOUD_REGION: sa-brazil-1
SWR_ORGANIZATION: devopsbrdev
IMAGE_NAME: cv-manager
IMAGE_TAG: latest
NAMESPACE: cci-workspace-resume-infra
DEPLOYMENT: hello-world-deployment
PROJECT_ID: 4e3eb0b6e82f41a1bc07bf0127edbf77
DATABASE_URL: ${{secrets.DATABASE_URL}}
TEST_DATABASE_URL: ${{vars.TEST_DATABASE_URL}}
SECRET_KEY: ${{secrets.SECRET_KEY}}
ALGORITHM: ${{secrets.ALGORITHM}}
ACCESS_TOKEN_EXPIRE_MINUTES: ${{secrets.ACCESS_TOKEN_EXPIRE_MINUTES}}
POSTGRES_USER: ${{secrets.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
POSTGRES_DB: ${{secrets.POSTGRES_DB}}
PAGE: ${{vars.PAGE}}
PAGE_SIZE: ${{vars.PAGE_SIZE}}
ORDERING: ${{vars.ORDERING}}
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: ${{secrets.POSTGRES_DB}}
POSTGRES_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
POSTGRES_USER: ${{secrets.POSTGRES_USER}}
ports:
- 5432:5432
steps:
- name: Cloning the Repository
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11.1"
- name: Install Poetry
run: pipx install poetry
- name: Install Dependencies
run: poetry install
- name: Run tests
run: poetry run task test
- name: Checkout code
uses: actions/checkout@v2
# - name: Huawei Cloud Software Repository for Container (SWR) Login
# uses: huaweicloud/[email protected]
# with:
# access-key-id: ${{ secrets.ACCESS_KEY }}
# access-key-secret: ${{ secrets.SECRET_ACCESS_KEY }}
# region: ${{ env.CLOUD_REGION }}
# - name: Build Docker Image
# id: build-image
# env:
# IMAGE_BUILD_NAME: swr.${{env.CLOUD_REGION}}.myhuaweicloud.com/${{env.SWR_ORGANIZATION}}/${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}
# run: docker build -t ${{env.IMAGE_BUILD_NAME}} .
# - name: Push Docker Image
# env:
# IMAGE_BUILD_NAME: swr.${{env.CLOUD_REGION}}.myhuaweicloud.com/${{env.SWR_ORGANIZATION}}/${{env.IMAGE_NAME}}:${{env.IMAGE_TAG}}
# run: |
# docker push ${{ env.IMAGE_BUILD_NAME }}
# echo "::set-output name=image::${{env.IMAGE_BUILD_NAME}}"