Skip to content

Commit fa31487

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 6397ab8 commit fa31487

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/production.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,23 @@ 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+
<<<<<<< HEAD
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
4345
with:
4446
result: ${{ steps.alls-green.outcome }}
4547
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
48+
=======
49+
allowed-skips: update-helm
50+
>>>>>>> f220c19 (Add update-helm job to production workflow)
4651

4752
build:
4853
name: Build
@@ -66,6 +71,46 @@ jobs:
6671
# Push images only for merges into main and weekly schduled re-builds.
6772
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
6873

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

0 commit comments

Comments
 (0)