Build SDK Files & GCS Upload #53
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: Build SDK Files & GCS Upload | |
on: | |
workflow_dispatch: | |
jobs: | |
test_build_deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: "[Setup] Install dependencies" | |
run: yarn | |
- name: "[Build] Staging" | |
env: | |
STAGING_DOMAIN: ${{ secrets.STAGING_DOMAIN }} | |
run: BUILD_ORIGIN=${STAGING_DOMAIN} API=staging API_ORIGIN=${STAGING_DOMAIN} yarn build:staging | |
- name: "[Build] Production" | |
run: yarn build:prod | |
- name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
- name: "[Deploy] Upload SDK Files to GCS" | |
uses: 'google-github-actions/upload-cloud-storage@v1' | |
with: | |
path: 'build/releases' | |
destination: 'sdk-builds-persistence-onesignal/web-sdk/${{ github.sha }}' | |
parent: false | |
- name: "[Deploy] Upload AMP SDK Files to GCS" | |
uses: 'google-github-actions/upload-cloud-storage@v1' | |
with: | |
path: 'build/amp' | |
destination: 'sdk-builds-persistence-onesignal/web-sdk/${{ github.sha }}' | |
parent: false |