Skip to content

Commit 807f2cf

Browse files
committed
Add update-helm job to production workflow
After a successful build of release versions, dispatch the product-release.yml workflow on rstudio/helm via a GitHub App token sourced from the workbench-ide-release App (WORKBENCH_IDE_RELEASE_APP_ID / _PEM) so the helm chart's workbench image tag is updated to the new image version automatically.
1 parent 6397ab8 commit 807f2cf

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/production.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ jobs:
3131
timeout-minutes: 10
3232
needs:
3333
- build
34+
- update-helm
3435

3536
steps:
3637
- uses: re-actors/alls-green@release/v1
3738
id: alls-green
3839
with:
3940
jobs: ${{ toJSON(needs) }}
41+
allowed-skips: update-helm
4042
- if: always() && github.ref == 'refs/heads/main'
4143
continue-on-error: true
4244
uses: posit-dev/images-shared/.github/actions/slack-build-notify@main
@@ -66,6 +68,46 @@ jobs:
6668
# Push images only for merges into main and weekly schduled re-builds.
6769
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
6870

71+
update-helm:
72+
name: Update Helm
73+
if: ${{ needs.build.result == 'success' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') }}
74+
needs:
75+
- build
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v6
81+
82+
- name: Install bakery
83+
uses: posit-dev/images-shared/setup-bakery@main
84+
85+
- name: Get latest version
86+
id: version
87+
run: |
88+
APP_VERSION=$(bakery get version workbench)
89+
APP_VERSION="${APP_VERSION%%[+-]*}"
90+
echo "app-version=$APP_VERSION" >> "$GITHUB_OUTPUT"
91+
92+
- name: Generate GitHub App Token
93+
id: app-token
94+
uses: actions/create-github-app-token@v3
95+
with:
96+
app-id: ${{ secrets.WORKBENCH_IDE_RELEASE_APP_ID }}
97+
private-key: ${{ secrets.WORKBENCH_IDE_RELEASE_PEM }}
98+
owner: rstudio
99+
repositories: helm
100+
101+
- name: Dispatch Helm update
102+
env:
103+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
104+
APP_VERSION: ${{ steps.version.outputs.app-version }}
105+
run: |
106+
gh workflow run product-release.yml \
107+
--repo rstudio/helm \
108+
--field product=workbench \
109+
--field version="$APP_VERSION"
110+
69111
clean:
70112
name: Clean
71113
if: always() && github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)