Add job permissions #56
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 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup gcloud authentication | |
uses: google-github-actions/auth@v2 | |
id: 'auth' | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
workload_identity_provider: ${{ secrets.GCP_WIP }} | |
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
token_format: access_token | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
version: "469.0.0" | |
- name: Build to Mainnet Dashboard | |
env: | |
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks.json | |
REACT_APP_LABELS_PER_UNIT: 4294967296 | |
run: | | |
yarn | |
yarn build | |
- name: Upload to Mainnet Dashboard | |
run: gsutil -m rsync -r -d ./build gs://spacemesh-dash | |
- name: Set cache-control headers for Mainnet Dashboard | |
run: gsutil -m setmeta -h "Cache-Control:public, max-age=0, no-transform" -r gs://spacemesh-dash/index.html |