Deploy production #50
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: "Deploy production" | |
# concurrency: | |
# group: deploy-production | |
# cancel-in-progress: true | |
"on": | |
workflow_dispatch: | |
inputs: | |
ref: | |
type: string | |
description: "The branch, tag or SHA to checkout" | |
required: true | |
default: "HEAD" | |
jobs: | |
build_and_deploy: | |
if: ${{ github.event.repository.full_name == github.repository }} | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: "${{ github.event.inputs.ref }}" | |
fetch-depth: 0 | |
# Whether to configure the token or SSH key with the local git config | |
# Default: true | |
persist-credentials: false # <--- checking this in commit context | |
- name: "Enable yarn cache" | |
uses: c-hive/gha-yarn-cache@v2 # using cache | |
- name: "Setup node@16" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: "Install dependencies" | |
run: | | |
yarn set version 3.1.1 | |
yarn install | |
- name: "Build" | |
run: yarn run ci:build:prod | |
- name: "Setup LTS node for deployment" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 'lts/*' | |
- name: "Setup node@18" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
- name: "Deploy target: prod-mainnet" | |
uses: matter-labs/action-hosting-deploy@main | |
with: | |
repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZKSYNC_VUE_MAINNET }}" | |
target: mainnet | |
projectId: zksync-vue-mainnet | |
channelId: live | |
- name: "Prepare /functions/" | |
run: npm --prefix functions i | |
- name: "Deploy functions to firebase: zksync-vue-mainnet" | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only functions | |
env: | |
PROJECT_ID: zksync-vue-mainnet | |
FIREBASE_TOKEN: '${{ secrets.FIREBASE_DEPLOY_TOKEN }}' |