-
-
Save pcampina/4fb014a56dd0572171b1b101751e1a85 to your computer and use it in GitHub Desktop.
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: CI | |
on: | |
push: | |
branches: [master] | |
env: | |
BUCKET: reactdeploy.getomni.dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12.x | |
- name: Install dependencies | |
run: yarn install | |
# - name: Run tests | |
# run: yarn test --watchAll false | |
- name: Build | |
run: yarn build | |
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master | |
with: | |
version: '290.0.1' | |
project_id: ${{ secrets.GCP_PROJECT }} | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
export_default_credentials: true | |
- name: Upload filed to bucket | |
run: gsutil -m rsync -R ./build gs://"$BUCKET" | |
- name: Allow public access | |
run: gsutil -m acl ch -R -u AllUsers:R gs://"$BUCKET" | |
# Set cache meta for static files | |
- name: Set Cache-Control | |
run: gsutil -m setmeta -h "Cache-Control:public, max-age=15768000" gs://"$BUCKET"/**/*.{png,svg,css,js} | |
# Set cache meta for index.html | |
- name: Set Cache-Control | |
run: gsutil setmeta -h "Cache-Control:no-cache, no-store" gs://"$BUCKET"/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment