Created
March 16, 2022 16:47
-
-
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
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: 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