Skip to content

Commit

Permalink
👷 (ci): Deploy directly to Pages instead of using gh-pages branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 11, 2023
1 parent 809d8d6 commit 6385c89
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 10 deletions.
58 changes: 48 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
7 changes: 7 additions & 0 deletions docs/docs/artifacthub-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repositoryID: cc52dcda-f192-4646-ae2b-d9170e4ecd6e
owners:
- name: gabe565
email: [email protected]
ignore:
- name: limo
version: ^0\.1\.[1-3]$

0 comments on commit 6385c89

Please sign in to comment.