-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Pull Request Events | ||
|
||
on: pull_request | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-unit: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: β¬οΈ Set up code | ||
uses: actions/checkout@v3 | ||
|
||
- name: β Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
|
||
- name: π₯ Download dependencies | ||
run: npm ci | ||
|
||
- name: π§Ή Lint | ||
run: npm run lint | ||
|
||
- name: π§ͺ Run tests | ||
run: npm test | ||
|
||
deploy-preview: | ||
name: Firebase preview | ||
runs-on: ubuntu-latest | ||
needs: test-unit | ||
if: ${{ github.event.sender.type == 'User' }} | ||
environment: | ||
name: dev | ||
|
||
steps: | ||
- name: π Deploy | ||
uses: agrc/firebase-website-deploy-composite-action@v1 | ||
with: | ||
identity-provider: ${{ secrets.IDENTITY_PROVIDER }} | ||
service-account-email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }} | ||
project-id: ${{ secrets.PROJECT_ID }} | ||
preview: yes | ||
build-command: npm run build:stage | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: Push Events | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
deployments: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release-please: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release-please.outputs.release_created }} | ||
|
||
steps: | ||
- name: π Create Release | ||
id: release-please | ||
uses: agrc/release-composite-action@v1 | ||
with: | ||
prerelease: ${{ github.ref_name == 'dev' }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
github-app-id: ${{ secrets.UGRC_RELEASE_BOT_APP_ID }} | ||
github-app-key: ${{ secrets.UGRC_RELEASE_BOT_APP_KEY }} | ||
github-app-name: ${{ secrets.UGRC_RELEASE_BOT_NAME }} | ||
github-app-email: ${{ secrets.UGRC_RELEASE_BOT_EMAIL }} | ||
|
||
rebuild-docs: | ||
runs-on: ubuntu-latest | ||
needs: release-please | ||
if: needs.release-please.outputs.release_created | ||
steps: | ||
- name: β¬οΈ Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: β Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
|
||
- name: π₯ Download dependencies | ||
run: npm ci | ||
|
||
- name: π Update Config Docs | ||
run: npm run update-config-docs | ||
|
||
- name: π Commit changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: 'docs' | ||
message: 'docs: update config docs' | ||
|
||
deploy-dev: | ||
name: Deploy to staging | ||
runs-on: ubuntu-latest | ||
needs: release-please | ||
environment: | ||
name: dev | ||
url: https://wfrc-rtp.dev.utah.gov | ||
if: github.ref_name == 'dev' && needs.release-please.outputs.release_created | ||
|
||
steps: | ||
- name: π Deploy | ||
uses: agrc/firebase-website-deploy-composite-action@v1 | ||
with: | ||
identity-provider: ${{ secrets.IDENTITY_PROVIDER }} | ||
service-account-email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }} | ||
project-id: ${{ secrets.PROJECT_ID }} | ||
build-command: npm run build:stage | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
deploy-prod: | ||
runs-on: ubuntu-latest | ||
needs: release-please | ||
if: needs.release-please.outputs.release_created | ||
steps: | ||
- name: β¬οΈ Set up code | ||
uses: actions/checkout@v3 | ||
|
||
- name: β Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: npm | ||
|
||
- name: π₯ Download dependencies | ||
run: npm ci | ||
|
||
- name: π Run build | ||
run: npm run build | ||
|
||
- name: π Compress | ||
run: npm run zip | ||
|
||
- name: π Create release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
tag: ${{ needs.release-please.outputs.tag_name }} | ||
file: build.zip |