From 6385c89838026fc67a8abd61498a8b5e3fc7cd5f Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Tue, 11 Apr 2023 02:47:09 -0500 Subject: [PATCH] :construction_worker: (ci): Deploy directly to Pages instead of using `gh-pages` branch --- .github/workflows/release.yaml | 58 ++++++++++++++++++++++++++++------ docs/docs/artifacthub-repo.yml | 7 ++++ 2 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 docs/docs/artifacthub-repo.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0a998f588..710a52b84 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,6 +5,15 @@ on: branches: - main +permissions: + contents: write + pages: write + id-token: write + +concurrency: + group: release + cancel-in-progress: false + jobs: release-charts: name: Release Charts @@ -40,10 +49,10 @@ jobs: env: CR_TOKEN: "${{ github.token }}" CR_SKIP_EXISTING: "true" + CR_PAGES_BRANCH: helm-index - release-docs: - name: Release Docs - needs: [release-charts] + build-docs: + name: Build Docs runs-on: ubuntu-latest steps: - name: Checkout @@ -73,11 +82,40 @@ jobs: working-directory: docs run: mkdocs build - - name: Deploy docs - uses: JamesIves/github-pages-deploy-action@v4 + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: docs + path: docs/site + + deploy-site: + name: Deploy Site + runs-on: ubuntu-latest + needs: [release-charts, build-docs] + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout Helm index + uses: actions/checkout@v3 with: - commit-message: Deploy docs from ${{ github.repository }}@${{ github.sha }} - folder: docs/site - clean-exclude: | - artifacthub-repo.yml - index.yaml + path: helm-index + ref: refs/heads/helm-index + + - name: Download docs artifact + uses: actions/download-artifact@v3 + with: + name: docs + path: docs + + - name: Move Helm index to docs + run: mv helm-index/* docs + + - name: Upload release artifact + uses: actions/upload-pages-artifact@v1 + with: + path: docs + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/docs/docs/artifacthub-repo.yml b/docs/docs/artifacthub-repo.yml new file mode 100644 index 000000000..7300e7275 --- /dev/null +++ b/docs/docs/artifacthub-repo.yml @@ -0,0 +1,7 @@ +repositoryID: cc52dcda-f192-4646-ae2b-d9170e4ecd6e +owners: + - name: gabe565 + email: gabe565@gmail.com +ignore: + - name: limo + version: ^0\.1\.[1-3]$