Merge pull request #1246 from AlexsLemonade/dev #74
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: prod-backend | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| name: prod-backend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Load 1Password Secrets | |
| id: op-load-secrets | |
| uses: 1password/load-secrets-action@v1 | |
| with: | |
| export-env: true | |
| env: | |
| OP_SERVICE_ACCOUNT_TOKEN: "${{ secrets.OP_ENGINEERING_AUTH_TOKEN }}" | |
| DATABASE_PASSWORD: "${{ secrets.OP_PRODUCTION_DATABASE_PASSWORD }}" | |
| DJANGO_SECRET_KEY: "${{ secrets.OP_PRODUCTION_DJANGO_SECRET_KEY }}" | |
| DOCKER_USERNAME: "${{ secrets.OP_DOCKER_USERNAME }}" | |
| DOCKER_PASSWORD: "${{ secrets.OP_DOCKER_PASSWORD }}" | |
| AWS_ACCESS_KEY_ID: "${{ secrets.OP_AWS_ACCESS_KEY_ID }}" | |
| AWS_SECRET_ACCESS_KEY: "${{ secrets.OP_AWS_SECRET_ACCESS_KEY }}" | |
| SSH_PRIVATE_KEY: "${{ secrets.OP_SSH_PRIVATE_KEY }}" | |
| SSH_PUBLIC_KEY: "${{ secrets.OP_SSH_PUBLIC_KEY }}" | |
| SENTRY_DSN: "${{ secrets.OP_SENTRY_DSN }}" | |
| SLACK_CCDL_TEST_CHANNEL_EMAIL: "${{ secrets.OP_SLACK_CCDL_TEST_CHANNEL_EMAIL }}" | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.11.4 | |
| - name: Destroy Legacy | |
| run: cd infrastructure && python3 deploy.py -s prod -u deployer -a ccdl -v $(git rev-parse HEAD) --destroy | |
| env: | |
| SENTRY_ENV: prod-api | |
| - name: Deploy | |
| run: cd infrastructure && python3 deploy.py -s prod -u deployer -a ccdl -v $(git rev-parse HEAD) --project | |
| env: | |
| SENTRY_ENV: staging-api | |
| AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" | |
| AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" |