Fix container name #3
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 to Google Cloud Run | |
on: | |
push: | |
branches: | |
- main | |
- redeploy-action | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
project_id: htan-dcc | |
- name: Log in to Google Artifact Registry | |
run: gcloud auth configure-docker us-docker.pkg.dev | |
- name: Build and push Docker image | |
run: | | |
cd src | |
docker build . -t us-docker.pkg.dev/htan-dcc/gcr.io/data-release-validation:${{ github.sha }} | |
docker push us-docker.pkg.dev/htan-dcc/gcr.io/data-release-validation:${{ github.sha }} | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 1.7.0 | |
- name: Terraform Init | |
run: terraform init | |
- name: Terraform Plan | |
run: terraform plan -var="image_tag=${{ github.sha }}" | |
- name: Terraform Apply | |
run: terraform apply -var="image_tag=${{ github.sha }}" -auto-approve |