e-younan is running CI/CD actions #24
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: Update documentation website | |
run-name: ${{ github.actor }} is running CI/CD actions | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'docs/**' | |
jobs: | |
deploy-web-gcp: | |
name: Deploy web app to GCP | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: docs | |
permissions: | |
contents: "read" | |
id-token: "write" | |
steps: | |
- id: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
cache: yarn | |
cache-dependency-path: ./docs/yarn.lock | |
- id: "auth" | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.GCP_SA_KEY }}" | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
- name: "Install dependencies" | |
run: yarn install --frozen-lockfile | |
- name: "Build application" | |
run: "yarn build" | |
- name: "Set project ID" | |
run: "gcloud config set project react-native-header" | |
- name: "Deploy" | |
run: "yarn deploy --service-account ${{ vars.GCP_SA_EMAIL }}" |