Skip to content

Instantly share code, notes, and snippets.

@perryism
Created March 16, 2022 16:47
Show Gist options
  • Save perryism/e31c734a20ddc33fbfb9ec8368118af5 to your computer and use it in GitHub Desktop.
Save perryism/e31c734a20ddc33fbfb9ec8368118af5 to your computer and use it in GitHub Desktop.
Github actions to deploy react app as a static site to google cloud
name: Deployment
on: [push]
jobs:
  Build-App:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '17'
          cache: 'npm'
      - run: npm install
      - run: npm run build
      - id: 'auth'
        uses: 'google-github-actions/auth@v0'
        with:
          credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
      - uses: google-github-actions/setup-gcloud@v0
      - run: cd build && gsutil cp -r * gs://${{ secrets.GCS_BUCKET }}/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment