Skip to content

Commit

Permalink
fix: moved release-please to its own file (#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
cberg-aot authored Sep 23, 2024
1 parent e0f581a commit 1cbac35
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 14 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,3 @@ jobs:
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ needs.vars.outputs.pr }}
tags: test #Promote images AFTER successful deploy

release-please:
name: Release-Please
needs: [promote-images-test, vars]
runs-on: ubuntu-22.04
timeout-minutes: 2
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: release-please-action
changelog-types: '[{"type":"ORV2","section":"Features","hidden":false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"build","section":"Miscellaneous","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"ci","section":"Miscellaneous","hidden":false},{"type":"docs","section":"Miscellaneous","hidden":false},{"type":"perf","section":"Miscellaneous","hidden":false},{"type":"refactor","section":"Miscellaneous","hidden":false},{"type":"revert","section":"Miscellaneous","hidden":false},{"type":"style","section":"Miscellaneous","hidden":false},{"type":"test","section":"Miscellaneous","hidden":false}]'
29 changes: 29 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
on:
push:
branches: [main]
paths-ignore:
- '*.md'
- '.github/**'
- 'common/graphics/**'
- '!.github/workflows/deploy.yml'
- '!.github/workflows/merge.yml'

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
vars:
release-please:
name: Release-Please
runs-on: ubuntu-22.04
timeout-minutes: 2
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: release-please-action
changelog-types: '[{"type":"ORV2","section":"Features","hidden":false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"build","section":"Miscellaneous","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"ci","section":"Miscellaneous","hidden":false},{"type":"docs","section":"Miscellaneous","hidden":false},{"type":"perf","section":"Miscellaneous","hidden":false},{"type":"refactor","section":"Miscellaneous","hidden":false},{"type":"revert","section":"Miscellaneous","hidden":false},{"type":"style","section":"Miscellaneous","hidden":false},{"type":"test","section":"Miscellaneous","hidden":false}]'
57 changes: 55 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,72 @@ jobs:
id: release-name
run: |
echo release-name=$(curl https://api.github.com/repos/bcgov/onroutebc/releases/latest | jq -r .tag_name) >> $GITHUB_OUTPUT
promote-images-release:
name: Promote Images - Release
needs: [vars]
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [dops, vehicles, frontend, scheduler, policy]
timeout-minutes: 2
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: test
tags: ${{ needs.vars.outputs.release-name }}

deploys-uat:
name: Deploys (Uat)
needs: [vars]
needs: [vars,promote-images-release]
uses: ./.github/workflows/uat.yml
secrets: inherit
with:
tag: ${{ needs.vars.outputs.release-name }}

promote-images-uat:
name: Promote Images - Uat
needs: [vars,deploys-uat]
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [dops, vehicles, frontend, scheduler, policy]
timeout-minutes: 2
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ needs.vars.outputs.release-name }}
tags: uat

deploys-prod:
name: Deploys (Prod)
needs: [deploys-uat, vars]
needs: [vars,promote-images-uat]
uses: ./.github/workflows/prod.yml
secrets: inherit
with:
tag: ${{ needs.vars.outputs.release-name }}

promote-images-prod:
name: Promote Images - Prod
needs: [vars,deploys-prod]
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [dops, vehicles, frontend, scheduler, policy]
timeout-minutes: 2
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: uat
tags: prod

0 comments on commit 1cbac35

Please sign in to comment.