Merge pull request #186 from kube-logging/plugins-anchor-fixes #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish main | |
env: | |
doc_versionnumber: "docs" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- "master" | |
paths: | |
- ".github/workflows/publish-main.yaml" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
environment: | |
name: github-pages-test | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
with: | |
submodules: 'recursive' | |
- name: Set up Pages | |
id: pages | |
uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 # v3.0.6 | |
- name: Set up Hugo | |
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d # v2.6.0 | |
with: | |
hugo-version: '0.110.0' | |
extended: true | |
- name: Set up Node | |
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: | | |
cd themes/docsy | |
npm install | |
- name: Set up PostCSS | |
run: npm install --save-dev autoprefixer postcss-cli postcss | |
- name: Build | |
run: hugo --environment production --baseURL ${{ steps.pages.outputs.base_url }}/ | |
# - name: Upload artifact | |
# uses: actions/upload-pages-artifact@64bcae551a7b18bcb9a09042ddf1960979799187 # v1.0.8 | |
# with: | |
# path: ./public/ | |
- name: Checkout code to update | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
with: | |
ref: 'gh-pages-test' | |
path: 'tmp/gh-pages' | |
# - name: Display file structure | |
# run: ls -R | |
- name: Copy built site to GH pages | |
run: | | |
rm -rf tmp/gh-pages/${{ env.doc_versionnumber }} | |
rm -rf tmp/gh-pages/css | |
rm -rf tmp/gh-pages/scss | |
rm -rf tmp/gh-pages/js | |
rm -rf tmp/gh-pages/_print | |
rsync -a public/ tmp/gh-pages/ | |
- name: Pagefind search index | |
run: npm_config_yes=true npx pagefind --bundle-dir pagefind --source ./tmp/gh-pages | |
- name: Commit & Push changes | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: 'Publish updated main docs, ${{ github.event.repository.pushed_at}}' | |
branch: 'gh-pages-test' | |
directory: 'tmp/gh-pages' |