diff --git a/.github/workflows/charts-release-ghpages.yaml b/.github/workflows/charts-release-ghpages.yaml index d0f71592..ae78c8f6 100644 --- a/.github/workflows/charts-release-ghpages.yaml +++ b/.github/workflows/charts-release-ghpages.yaml @@ -1,15 +1,8 @@ name: "Charts: Release to GitHub pages" -concurrency: helm-release - on: workflow_call: inputs: - token: - required: true - default: "${{ github.token }}" - description: "The Github API token to use" - type: string charts: description: > Json encoded list of Helm charts to release. @@ -17,6 +10,11 @@ on: default: "[]" required: false type: string + secrets: + BJWS_APP_ID: + required: true + BJWS_APP_PRIVATE_KEY: + required: true env: HELM_VERSION: 3.9.2 @@ -26,17 +24,24 @@ jobs: name: Release charts runs-on: ubuntu-22.04 steps: + - name: Get k8s-at-home token + id: get-app-token + uses: getsentry/action-github-app-token@v1 + with: + app_id: ${{ secrets.BJWS_APP_ID }} + private_key: ${{ secrets.BJWS_APP_PRIVATE_KEY }} + - name: Checkout charts branch uses: actions/checkout@v3 with: - token: ${{ inputs.token }} + token: ${{ steps.get-app-token.outputs.token }} path: "src" fetch-depth: 0 - name: Checkout gh-pages branch uses: actions/checkout@v3 with: - token: ${{ inputs.token }} + token: ${{ steps.get-app-token.outputs.token }} path: "dest" ref: "gh-pages" fetch-depth: 0 diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/charts-release.yaml index 8229ef52..db6bd566 100644 --- a/.github/workflows/charts-release.yaml +++ b/.github/workflows/charts-release.yaml @@ -11,6 +11,7 @@ on: Defaults to releasing everything. default: "" required: false + push: branches: - main @@ -25,22 +26,18 @@ jobs: name: Prepare data required for release runs-on: ubuntu-22.04 outputs: - token: ${{ steps.get-app-token.outputs.token }} charts-to-release: ${{ steps.collect-charts.outputs.charts }} steps: - - name: Get k8s-at-home token - id: get-app-token - uses: getsentry/action-github-app-token@v1 + - name: Checkout + uses: actions/checkout@v3 with: - app_id: ${{ secrets.BJWS_APP_ID }} - private_key: ${{ secrets.BJWS_APP_PRIVATE_KEY }} + fetch-depth: 0 - name: Collect charts to release - uses: ./src/.github/actions/collect-charts + uses: ./.github/actions/collect-charts id: collect-charts with: - token: ${{ steps.get-app-token.outputs.token }} - repoConfigFile: ./src/.ci/repo-config.yaml + repoConfigFile: ./.ci/repo-config.yaml overrideCharts: "[${{ inputs.charts }}]" release-github-pages: @@ -49,5 +46,5 @@ jobs: needs: - prepare with: - token: ${{ needs.prepare.outputs.token }} - charts: "[${{ needs.prepare.outputs.charts-to-release }}]" + charts: "${{ needs.prepare.outputs.charts-to-release }}" + secrets: inherit