Skip to content

Refactor CI workflows #38

Refactor CI workflows

Refactor CI workflows #38

name: Deploy to Staging
# on:
# push:
# branches:
# - main
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.run_id }}
jobs:
deploy:
name: Deploy application
runs-on: ubuntu-latest
environment: staging
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.CI_GITHUB_PAT }}
- name: Setup environment
uses: ./.github/actions/setup-node-environment
- name: Build application
env:
NODE_OPTIONS: '--max_old_space_size=8192'
VITE_QUERY_DEVTOOLS_ENABLED: true
DOTENV_PRIVATE_KEY_STAGING: ${{ secrets.DOTENV_PRIVATE_KEY }}
run: npm run build -- --mode staging
# TODO: Test against new staging environment and enable before merging PR
# - name: Deploy app to staging
# id: deploy
# uses: FirebaseExtended/action-hosting-deploy@v0
# with:
# repoToken: '${{ secrets.GITHUB_TOKEN }}'
# firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ADMIN }}'
# projectId: '${{ secrets.FIREBASE_PROJECT_ID_ADMIN }}'
# channelId: live
# - name: Deploy Firestore rules to staging
# if: steps.deploy.outcome == 'success'
# uses: ./.github/actions/deploy-firestore-rules
# with:
# admin-service-account-key: ${{ secrets.FIRESTORE_SERVICE_ACCOUNT_ADMIN }}
# admin-project-id: ${{ secrets.FIREBASE_PROJECT_ID_ADMIN }}
# assessment-service-account-key: ${{ secrets.FIRESTORE_SERVICE_ACCOUNT_ASSESSMENT }}
# assessment-project-id: ${{ secrets.FIREBASE_PROJECT_ID_ASSESSMENT }}
# - name: Deploy Firestore indexes to staging
# if: steps.deploy.outcome == 'success'
# uses: ./.github/actions/deploy-firestore-rules
# with:
# admin-service-account-key: ${{ secrets.FIRESTORE_SERVICE_ACCOUNT_ADMIN }}
# admin-project-id: ${{ secrets.FIREBASE_PROJECT_ID_ADMIN }}
# assessment-service-account-key: ${{ secrets.FIRESTORE_SERVICE_ACCOUNT_ASSESSMENT }}
# assessment-project-id: ${{ secrets.FIREBASE_PROJECT_ID_ASSESSMENT }}
update-manifests:
name: Update manifests
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
projects: ${{ fromJSON(vars.ROAR_PROJECTS) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: 'roar-dashboard'
- name: List repository contents
run: |
pwd
ls -la
- name: Update ${{ matrix.projects.name }} deployment manifest
uses: ./roar-dashboard/.github/actions/update-deployment-manifest
with:
project-repo: ${{ matrix.projects.repo }}
project-name: ${{ matrix.projects.name }}
token: ${{ secrets.CI_GITHUB_PAT }}
sha: ${{ github.event.pull_request.head.sha }}