Skip to content

deploy-extension-dev #1

deploy-extension-dev

deploy-extension-dev #1

name: ⭐️ Deploy PLATEAU Extension dev
on:
workflow_dispatch:
repository_dispatch:
types: [deploy-extension-dev]
env:
GCS_DEST: gs://plateau-dev-reearth-app-bucket
PLATEAU_ORIGIN: https://app.reearth.plateau.dev.reearth.io/extension
jobs:
deploy_extension:
runs-on: ubuntu-latest
if: github.event.repository.full_name == 'eukarya-inc/PLATEAU-VIEW-3.0'
environment: dev
permissions:
contents: read
id-token: write
packages: write
defaults:
run:
working-directory: extension
steps:
- uses: actions/checkout@v3
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: yarn install
- name: Build
env:
NODE_ENV: "development"
run: yarn build
- name: Deploy
run: gsutil -m -h "Cache-Control:no-store" rsync -x "^estat/.*$" -dr dist ${{ env.GCS_DEST }}/extension
- name: Pack extension
run: tar -zcvf plateauview-extension.tar.gz dist
- name: Save as artifact
uses: actions/upload-artifact@v4
with:
name: plateauview-extension
path: extension/plateauview-extension.tar.gz