feat(ci-cd): ready for merge #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: Deploy Xplorers API to GCP | |
on: push | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
deploy-xplorers-api: | |
name: Deploy Xplorers API to GCP | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: auth | |
uses: google-github-actions/[email protected] | |
with: | |
workload_identity_provider: ${{ secrets.GOOGLE_CLOUD_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Install taskfile | |
run: | | |
sudo snap install task --classic | |
- name: Terraform Plan | |
run: task terraform-plan | |
- name: Terraform Apply | |
if: github.ref == 'refs/heads/"main"' && github.event_name == 'push' | |
run: task terraform-apply |