Build SDK Files & GCS Upload #38
Workflow file for this run
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 | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install Yarn | |
run: npm install -g yarn | |
- 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 |