Skip to content

Merge pull request #945 from eisbuk/fix/bookings-deadline #424

Merge pull request #945 from eisbuk/fix/bookings-deadline

Merge pull request #945 from eisbuk/fix/bookings-deadline #424

name: Deploy to production
"on":
push:
branches:
- master
jobs:
deploy:
environment: Production
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Install expect
run: sudo apt-get -y install expect
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Cache node modules and firebase emulators
uses: actions/cache@v3
with:
path: |
~/.rush
~/.pnpm-store
common/temp
**/node_modules
~/.cache/firebase/emulators
key: ${{ runner.os }}-modules-emulators-node18-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Add rush directory to PATH
run: echo PATH=$PWD/common/scripts/:$PATH >> $GITHUB_ENV
- name: Install dependencies
run: rush update
- name: Build eisbuk packages
run: rush build
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Generate name for sentry release
run: echo "SENTRY_RELEASE=$(date +%Y-%m-%d)-${{ env.GITHUB_SHA_SHORT }}" >> $GITHUB_ENV
- name: Build app
run: cd packages/client && rushx build:prod
env:
REACT_APP_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
REACT_APP_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
REACT_APP_DATABASE_URL: ${{ secrets.DATABASE_URL }}
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
REACT_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
REACT_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
REACT_APP_FIREBASE_MEASUREMENT_ID: ${{ secrets.FIREBASE_MEASUREMENT_ID }}
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_IGORICE_DSN }}
REACT_APP_SENTRY_ENVIRONMENT: production
REACT_APP_SENTRY_RELEASE: ${{ env.SENTRY_RELEASE }}
- name: Create Sentry release for client app
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: eisbuk
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
with:
environment: production
sourcemaps: ./packages/client/dist/assets
version: ${{ env.SENTRY_RELEASE }}
- name: Create Sentry release for client app
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: eisbuk
SENTRY_PROJECT: functions
SENTRY_URL: ${{ secrets.SENTRY_URL }}
with:
environment: production
sourcemaps: ./packages/functions/dist/
version: ${{ env.SENTRY_RELEASE }}
- name: Deploy to firebase
run: |
echo FUNCTIONS_SENTRY_DSN="$FUNCTIONS_SENTRY_DSN" > packages/functions/.env
echo REACT_APP_SENTRY_RELEASE="$REACT_APP_SENTRY_RELEASE" >> packages/functions/.env
rush deploy:production
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_EISBUK }}
FUNCTIONS_SENTRY_DSN: ${{ secrets.FUNCTIONS_SENTRY_DSN }}
REACT_APP_SENTRY_RELEASE: ${{ env.SENTRY_RELEASE }}