Move vars to github environment #1
This file contains 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: Deploy | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: ${{ vars.environment }} | |
env: | |
VPC_ID: ${{ vars.VPCID }} | |
DOMAIN_NAME: ${{ vars.domain-name }} | |
ALB_LISTENER_ARN: ${{ vars.alb-listener-arn }} | |
# Django Settings | |
DJANGO_DEBUG: ${{ vars.django-debug }} | |
DJANGO_ADMIN_URL: ${{ secrets.DJANGO_ADMIN_URL }} | |
DJANGO_ALLOWED_HOSTS: ${{ secrets.DJANGO_ALLOWED_HOSTS }} | |
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} | |
DJANGO_SECURE_SSL_REDIRECT: ${{ secrets.DJANGO_SECURE_SSL_REDIRECT }} | |
DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }} | |
CASEI_GH_TOKEN: ${{ secrets.CASEI_GH_TOKEN }} | |
# DB Credentials for RDS instance | |
DB_NAME: ${{ secrets.DB_NAME }} | |
DB_ENGINE: ${{ secrets.DB_ENGINE }} | |
DB_HOST: ${{ secrets.DB_HOST }} | |
DB_USER: ${{ secrets.DB_USER }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
DB_PORT: ${{ secrets.DB_PORT }} | |
# Other | |
GCMD_SYNC_RECIPIENTS: ${{ secrets.GCMD_SYNC_RECIPIENTS }} | |
GCMD_SYNC_SOURCE_EMAIL: ${{ secrets.GCMD_SYNC_SOURCE_EMAIL }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
lfs: "true" | |
submodules: "recursive" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "14" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
cache: "pip" # caching pip dependencies | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ vars.ROLETOASSUME }} | |
role-session-name: ${{ github.actor }} | |
aws-region: ${{ vars.aws-region }} | |
- name: Install dependencies | |
run: | | |
pip install -r deploy/requirements.txt | |
- name: CDK Deploy | |
run: | | |
npx cdk deploy \ | |
"*-application" \ | |
--exclusively \ | |
--require-approval never |