Extraction #37
Workflow file for this run
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: Backend Workflow | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
- release | |
jobs: | |
flake8_checker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install flake8 | |
run: pip install flake8 | |
- name: Run flake8 | |
uses: suo/flake8-github-action@releases/v1 | |
with: | |
checkName: 'flake8_checker' # NOTE: this needs to be the same as the job name | |
terraform: | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
url: https://server.labs.thedeep.io/admin/ | |
defaults: | |
run: | |
working-directory: "./" | |
if: github.ref == 'refs/heads/release' | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 1.1.2 | |
- name: Terraform init | |
id: init | |
run: terraform init -upgrade | |
- name: Terraform validate | |
id: validate | |
run: terraform validate | |
- name: Terraform plan | |
id: plan | |
run: terraform plan -var-file=prod.tfvars -no-color | |
- name: Terraform apply | |
id: apply | |
run: terraform apply -var-file=prod.tfvars -auto-approve -no-color |