Updated GitHub Actions workflow #9
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: CI/CD Pipeline for Azure Resume | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Add any other build steps you might need, for example, linting, testing, etc. | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
- name: Navigate to Terraform Directory # Add this step | |
run: cd azure-resume-terraform/ | |
- name: Terraform Initialize | |
run: terraform init | |
working-directory: azure-resume-terraform | |
- name: Terraform Validate | |
run: terraform validate | |
working-directory: azure-resume-terraform | |
- name: Terraform Plan | |
run: terraform plan -no-color | |
working-directory: azure-resume-terraform | |
continue-on-error: true | |
- name: Terraform Apply | |
run: terraform apply -auto-approve | |
working-directory: azure-resume-terraform | |
- name: Logout of Azure | |
run: az logout |