Skip to content

Commit f220c19

Browse files
committed
Add update-helm job to production workflow
After a successful build on main or workflow_dispatch, dispatch the product-release workflow in rstudio/helm to update the Workbench chart appVersion.
1 parent cbb1486 commit f220c19

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
@@ -29,11 +29,13 @@ jobs:
2929
timeout-minutes: 10
3030
needs:
3131
- build
32+
- update-helm
3233

3334
steps:
3435
- uses: re-actors/alls-green@release/v1
3536
with:
3637
jobs: ${{ toJSON(needs) }}
38+
allowed-skips: update-helm
3739

3840
build:
3941
name: Build
@@ -57,6 +59,46 @@ jobs:
5759
# Push images only for merges into main and weekly schduled re-builds.
5860
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'schedule' }}
5961

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

0 commit comments

Comments
 (0)