diff --git a/.github/workflows/deploy_frontend.yml b/.github/workflows/deploy_frontend.yml new file mode 100644 index 0000000..944efb2 --- /dev/null +++ b/.github/workflows/deploy_frontend.yml @@ -0,0 +1,39 @@ +name: Deploy Frontend + +on: + push: + branches: ['main'] + paths: ['crabfit-frontend/**'] + +jobs: + deploy: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: crabfit-frontend + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 17 + cache: yarn + cache-dependency-path: '**/yarn.lock' + - run: yarn install --immutable + - run: yarn build + - name: Copy app.yaml to build + run: 'cp app.yaml ./build/app.yaml' + - id: auth + uses: google-github-actions/auth@v0 + with: + credentials_json: '${{ secrets.GCP_SA_KEY }}' + - id: deploy + uses: google-github-actions/deploy-appengine@v0 + with: + working_directory: crabfit-frontend/build + version: v1 diff --git a/crabfit-frontend/example-app.yaml b/crabfit-frontend/app.yaml similarity index 100% rename from crabfit-frontend/example-app.yaml rename to crabfit-frontend/app.yaml diff --git a/crabfit-frontend/deploy.sh b/crabfit-frontend/deploy.sh deleted file mode 100755 index 7fdae75..0000000 --- a/crabfit-frontend/deploy.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -yarn build - -cd build - -cat > app.yaml << EOF -runtime: nodejs12 -handlers: -- url: /(.*\..+)$ - static_files: \1 - upload: (.*\..+)$ - secure: always - redirect_http_response_code: 301 - -- url: /.* - static_files: index.html - upload: index.html - secure: always - redirect_http_response_code: 301 -EOF - -gcloud app deploy --project=crabfit --version=v1