-
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.
fix: implement standardized action workflows
Closes #68
- Loading branch information
Showing
4 changed files
with
136 additions
and
133 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
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: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout 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 tests | ||
run: npm test | ||
|
||
deploy-preview: | ||
name: Firebase preview | ||
runs-on: ubuntu-latest | ||
needs: test | ||
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,82 @@ | ||
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: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release-please.outputs.release_created }} | ||
released_version: ${{ steps.release-please.outputs.released_version }} | ||
|
||
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 }} | ||
|
||
deploy-dev: | ||
name: Deploy to staging | ||
runs-on: ubuntu-latest | ||
needs: release | ||
environment: | ||
name: dev | ||
url: https://electrofishing-query.dev.utah.gov | ||
if: github.ref_name == 'dev' && needs.release.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 }} | ||
prebuild-command: npx grunt bump --setversion=${{ needs.release.outputs.released_version }} | ||
build-command: npm run build:stage | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
deploy-prod: | ||
name: Deploy to production | ||
runs-on: ubuntu-latest | ||
needs: release | ||
environment: | ||
name: prod | ||
url: https://electrofishing-query.ugrc.utah.gov | ||
if: github.ref_name == 'main' && needs.release.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 }} | ||
prebuild-command: npx grunt bump --setversion=${{ needs.release.outputs.released_version }} | ||
project-id: ${{ secrets.PROJECT_ID }} | ||
build-command: npm run build:prod | ||
service-now-instance: ${{ secrets.SN_INSTANCE }} | ||
service-now-table: ${{ secrets.SN_TABLE }} | ||
service-now-system-id: ${{ secrets.SN_SYS_ID }} | ||
service-now-username: ${{ secrets.SN_USERNAME }} | ||
service-now-password: ${{ secrets.SN_PASSWORD }} | ||
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