Merge pull request #6 from sourcifyeth/staging #31
This file contains hidden or 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: Release on Google Bucket | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - staging | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: "auth staging" | |
| if: github.ref == 'refs/heads/staging' | |
| uses: "google-github-actions/auth@v2" | |
| with: | |
| workload_identity_provider: "projects/1019539084286/locations/global/workloadIdentityPools/github/providers/sourcify" | |
| service_account: "verify-ui-staging-deployer@sourcify-project.iam.gserviceaccount.com" | |
| - name: "auth main" | |
| if: github.ref == 'refs/heads/main' | |
| uses: "google-github-actions/auth@v2" | |
| with: | |
| workload_identity_provider: "projects/1019539084286/locations/global/workloadIdentityPools/github/providers/sourcify" | |
| service_account: "[email protected]" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "22.4.0" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Copy .env.build.staging to .env | |
| if: github.ref == 'refs/heads/staging' | |
| run: cp .env.build.staging .env | |
| - name: Copy .env.build.main to .env | |
| if: github.ref == 'refs/heads/main' | |
| run: cp .env.build.main .env | |
| - name: Set git commit hash | |
| run: echo -e "\nVITE_GIT_COMMIT=$(git rev-parse --short HEAD)" >> .env | |
| - name: Build | |
| run: npm run build | |
| - name: Upload files to Staging bucket | |
| if: github.ref == 'refs/heads/staging' | |
| uses: google-github-actions/upload-cloud-storage@v2 | |
| with: | |
| path: "build/client" | |
| destination: "verify-sourcify-ui-staging-bucket" | |
| parent: false | |
| glob: "**/*" | |
| - name: Upload files to Main bucket | |
| if: github.ref == 'refs/heads/main' | |
| uses: google-github-actions/upload-cloud-storage@v2 | |
| with: | |
| path: "build/client" | |
| destination: "verify-sourcify-ui-production-bucket" | |
| parent: false | |
| glob: "**/*" |