diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index a248a1c..c5ded37 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -1,5 +1,7 @@ name: Production on: + workflow_dispatch: + schedule: # Weekly rebuild of all images, to pick up any upstream changes. - cron: "15 3 * * 0" # At 03:15 on Sunday @@ -29,11 +31,13 @@ jobs: timeout-minutes: 10 needs: - build + - update-helm steps: - uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} + allowed-skips: update-helm build: name: Build @@ -55,8 +59,48 @@ jobs: runs-on: ubuntu-latest-4x dev-versions: "exclude" matrix-versions: "exclude" - # Push images only for merges into main and weekly schduled re-builds. - push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'schedule' }} + push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + + update-helm: + name: Update Helm + if: ${{ needs.build.result == 'success' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch') }} + needs: + - build + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Install bakery + uses: posit-dev/images-shared/setup-bakery@main + + - name: Get latest version + id: version + run: | + APP_VERSION=$(bakery get version workbench) + # Strip build metadata for helm appVersion (e.g. 2026.01.1+403.pro11 → 2026.01.1) + APP_VERSION="${APP_VERSION%%+*}" + echo "app-version=$APP_VERSION" >> $GITHUB_OUTPUT + + - name: Generate GitHub App Token + id: app-token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: rstudio + repositories: helm + + - name: Dispatch Helm update + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + APP_VERSION: ${{ steps.version.outputs.app-version }} + run: | + gh workflow run product-release.yml \ + --repo rstudio/helm \ + --field product=workbench \ + --field app-version="$APP_VERSION" clean: name: Clean