Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Make all GitHub action workflows conditional #637

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/cypress-network-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency:

jobs:
cypress-run:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Run Cypress Network Tests
runs-on: ubuntu-latest
timeout-minutes: 90
Expand All @@ -20,7 +21,7 @@ jobs:
browser: [chromium, edge]
containers: [1, 2]
env:
CYPRESS_BASE_URL: ${{ secrets.ROAR_PRODUCTION_URL }}
CYPRESS_BASE_URL: ${{ secrets.PRODUCTION_URL }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: Network Tests for Release ${{ github.event.release.tag_name }} "${{ github.event.release.name }}:" "${{ github.event.release.body }}"
COMMIT_INFO_SHA: ${{ github.event.release.release_id }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cypress-participant-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ concurrency:

jobs:
cypress-run:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Run Cypress Participant Tests
runs-on: ubuntu-latest
timeout-minutes: 90
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cypress-partner-admin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ concurrency:

jobs:
cypress-run:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Run Cypress Partner Admin Tests
runs-on: ubuntu-latest
timeout-minutes: 90
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/deploy-firestore-rules-indexes-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Deploy Firestore Rules and Indexes (Development)

jobs:
deploy-admin-rules:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Admin Rules
runs-on: ubuntu-latest
steps:
Expand All @@ -16,10 +17,11 @@ jobs:
with:
args: deploy --only firestore:rules
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN_DEV }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_ADMIN_DEV }}
PROJECT_ID: gse-roar-admin-dev
PROJECT_PATH: ./firebase/admin
deploy-assessment-rules:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Assessment Rules
runs-on: ubuntu-latest
steps:
Expand All @@ -30,10 +32,11 @@ jobs:
with:
args: deploy --only firestore:rules
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ASSESSMENT_DEV }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_ASSESSMENT_DEV }}
PROJECT_ID: gse-roar-assessment-dev
PROJECT_PATH: ./firebase/assessment
deploy-admin-indexes:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Admin Indexes
runs-on: ubuntu-latest
steps:
Expand All @@ -44,10 +47,11 @@ jobs:
with:
args: deploy --only firestore:indexes
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN_DEV }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_ADMIN_DEV }}
PROJECT_ID: gse-roar-admin-dev
PROJECT_PATH: ./firebase/admin
deploy-assessment-indexes:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Assessment Indexes
runs-on: ubuntu-latest
steps:
Expand All @@ -58,6 +62,6 @@ jobs:
with:
args: deploy --only firestore:indexes
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ASSESSMENT_DEV }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_ASSESSMENT_DEV }}
PROJECT_ID: gse-roar-assessment-dev
PROJECT_PATH: ./firebase/assessment
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name: Deploy Firestore Rules and Indexes (Production)

jobs:
deploy-admin-rules:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Admin Rules
runs-on: ubuntu-latest
steps:
Expand All @@ -18,10 +19,11 @@ jobs:
with:
args: deploy --only firestore:rules
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_ADMIN_PROD }}
PROJECT_ID: gse-roar-admin
PROJECT_PATH: ./firebase/admin
deploy-assessment-rules:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Assessment Rules
runs-on: ubuntu-latest
steps:
Expand All @@ -32,10 +34,11 @@ jobs:
with:
args: deploy --only firestore:rules
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ASSESSMENT }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_ASSESSMENT_PROD }}
PROJECT_ID: gse-roar-assessment
PROJECT_PATH: ./firebase/assessment
deploy-admin-indexes:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Admin Indexes
runs-on: ubuntu-latest
steps:
Expand All @@ -46,10 +49,11 @@ jobs:
with:
args: deploy --only firestore:indexes
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_ADMIN_PROD }}
PROJECT_ID: gse-roar-admin
PROJECT_PATH: ./firebase/admin
deploy-assessment-indexes:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Assessment Indexes
runs-on: ubuntu-latest
steps:
Expand All @@ -60,6 +64,6 @@ jobs:
with:
args: deploy --only firestore:indexes
env:
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ROAR_ASSESSMENT }}
GCP_SA_KEY: ${{ secrets.FIRESTORE_UPDATE_SERVICE_ACCOUNT_GSE_ASSESSMENT_PROD }}
PROJECT_ID: gse-roar-assessment
PROJECT_PATH: ./firebase/assessment
6 changes: 3 additions & 3 deletions .github/workflows/firebase-hosting-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
jobs:
build-and-preview:
name: Deploy Preview
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -24,8 +24,8 @@ jobs:
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN }}'
projectId: gse-roar-admin
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ADMIN_PROD }}'
projectId: '${{ secrets.FIREBASE_PROJECT_ID_ADMIN_PROD }}'
target: staging
- run: echo ${{ fromJson(steps.firebase-deploy.outputs.urls)[0] }}
outputs:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/firebase-hosting-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ name: Deploy to Firebase Hosting (production) with Pre-Release Tests
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
jobs:
# pre-release-tests:
# if: github.repository == 'yeatmanlab/roar-dashboard'
# name: Run Cypress Pre-Release Tests
# needs: [build-and-preview]
# runs-on: ubuntu-latest
Expand Down Expand Up @@ -45,6 +46,7 @@ jobs:
# ci-build-id: ${{ github.run_id }}-${{ matrix.browser }}

build-and-deploy:
if: github.repository == 'yeatmanlab/roar-dashboard'
name: Deploy to Firebase Production Hosting Channel
# needs: [pre-release-tests]
runs-on: ubuntu-latest
Expand All @@ -60,9 +62,9 @@ jobs:
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ADMIN_PROD }}'
channelId: live
projectId: gse-roar-admin
projectId: '${{ secrets.FIREBASE_PROJECT_ID_ADMIN_PROD }}'
target: production

- name: Create Sentry release and upload source maps
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/firebase-hosting-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name: Deploy to Firebase Hosting (staging)
- main
jobs:
build_and_deploy:
if: github.repository == 'yeatmanlab/roar-dashboard'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -21,7 +22,7 @@ jobs:
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ADMIN_PROD }}'
channelId: live
projectId: gse-roar-admin
projectId: '${{ secrets.FIREBASE_PROJECT_ID_ADMIN_PROD }}'
target: staging
Loading