Skip to content

Commit

Permalink
feat: update release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Oct 4, 2024
1 parent 0c5c778 commit b6ebe6c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
name: Front End Workflow
name: Pull Request Events

on:
push:
paths:
- "src/ClientApp/**"
- ".github/workflows/push.front.yml"
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:
name: Unit Testing Job
test-unit:
name: Unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/ClientApp

steps:
- name: ⬇️ Set up code
Expand All @@ -29,15 +27,9 @@ jobs:
with:
node-version: lts/*
cache: npm
cache-dependency-path: src/ClientApp/package-lock.json

- name: 📥 Download dependencies
run: npm ci

- name: 🏗 Run build script
run: npm run build:test --if-present
env:
CI: false

- name: 🧪 Run tests
run: npm run test
run: npm test
31 changes: 31 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Push Events

on:
push:
branches:
- dev
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release-please:
name: Create release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

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 }}
51 changes: 32 additions & 19 deletions .github/workflows/push.back.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
name: Back End Workflow
name: Release Events

on:
push:
branches:
- main
- dev
paths:
- "src/**"
- ".github/workflows/push.back.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
release:
types: [published]
workflow_dispatch:
inputs:
environment:
description: 'Environment to run tests against'
type: environment
required: true

permissions:
id-token: write
contents: read
deployments: write

jobs:
deploy-gcp-dev:
name: Deploy dev GCP infrastructure
deploy-dev:
name: Deploy to staging
runs-on: ubuntu-latest
environment:
name: dev
if: github.ref == 'refs/heads/dev'
url: https://fieldmap.dev.utah.gov
if: github.event.release.prerelease == true || inputs.environment == 'dev'

steps:
- name: ⬇️ Set up code
Expand Down Expand Up @@ -105,12 +103,13 @@ jobs:
secrets: |
/secrets/dotnet/appsettings.Production.json=dotnet-appsettings:latest
deploy-gcp-prod:
name: Deploy prod GCP infrastructure
deploy-prod:
name: Deploy to production
runs-on: ubuntu-latest
environment:
name: prod
if: github.ref == 'refs/heads/main'
url: https://atlas.utah.gov
if: github.event.release.prerelease == false || inputs.environment == 'prod'

steps:
- name: ⬇️ Set up code
Expand Down Expand Up @@ -201,3 +200,17 @@ jobs:
instance-name: ${{ secrets.SN_INSTANCE }}
table-name: ${{ secrets.SN_TABLE }}
system-id: ${{ secrets.SN_SYS_ID }}

notify:
name: Notifications
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write

steps:
- name: 💬 Comment on issues in release
uses: agrc/release-issue-notifications-action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b6ebe6c

Please sign in to comment.