Skip to content

Commit

Permalink
feat: test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
gregfrasco committed Aug 23, 2024
1 parent 7146697 commit 6fee3df
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
#if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
project_id: sail-intact
workload_identity_provider: projects/695814629538/locations/global/workloadIdentityPools/github/providers/github
Expand Down Expand Up @@ -46,4 +47,29 @@ jobs:
run: npm install

- name: Build
run: npm run build
run: npm run build

- name: Backup existing bucket contents
#if: success() && github.ref == 'refs/heads/main'
run: |
gsutil mv gs://intact-frontend/** gs://intact-frontend/backup/
echo "backup_done=true" >> $GITHUB_ENV
- name: Deploy to Google Cloud Bucket
uses: google-github-actions/upload-cloud-storage@v2
#if: success() && github.ref == 'refs/heads/main' && env.backup_done == 'true'
with:
path: /dist/
destination: intact-frontend
parent: false

- name: Remove backup
#if: success() && github.ref == 'refs/heads/main' && env.backup_done == 'true'
run: |
gsutil rm -r gs://intact-frontend/backup/
- name: Restore from backup (on failure)
#if: failure() && github.ref == 'refs/heads/main' && env.backup_done == 'true'
run: |
gsutil mv gs://intact-frontend-backup/** gs://intact-frontend/
gsutil -m rm -r gs://intact-frontend-backup/

0 comments on commit 6fee3df

Please sign in to comment.