.github/workflows/pull-request.yml
name: Deploy PR to octoboard-development
on:
pull_request:
types: [labeled, synchronize]
jobs:
deploy_server:
name: Deploy server
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.id, 2818529465)
environment:
name: octoboard-development-server
url: https://${{ github.head_ref }}-dot-octoboard-development.appspot.com
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ikuanyshbekov/app-yaml-env-compiler@v1.1
env:
SENTRY_DSN: ${{ secrets.APP_SENTRY_DSN }}
ENVIRONMENT: staging
- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v0.6.2
with:
project_id: octoboard-development
service_account_key: ${{ secrets.APP_ENGINE_SERVICE_ACCOUNT_OCTOBOARD_DEVELOPMENT }}
- name: Deploy to App Engine
run: gcloud app deploy --quiet --no-promote --version=${{ github.head_ref }}
deploy_client:
name: Deploy client
runs-on: ubuntu-latest
needs: deploy_server
if: contains(github.event.pull_request.labels.*.id, 2818529465)
environment:
name: octoboard-development-client
url: ${{ steps.preview.outputs.details_url }}
env:
REACT_APP_API_ROOT: https://${{ github.head_ref }}-dot-octoboard-development.appspot.com
REACT_APP_SENTRY_DSN: ${{ secrets.REACT_APP_SENTRY_DSN }}
REACT_APP_ENVIRONMENT: staging
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: npm ci && npm run build
- name: Preview
id: preview
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_OCTOBOARD_DEVELOPMENT }}"
projectId: octoboard-development
env:
FIREBASE_CLI_PREVIEWS: hostingchannels