Merge pull request #316 from Promptless/promptless/fluentd-drain-kill… #5
This file contains hidden or 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 version sample | |
| # When creating the publish workflow of a new release, update the env.doc_versionnumber variable, and the on.push.branches parameter | |
| env: | |
| doc_versionnumber: "4.0" | |
| on: | |
| push: | |
| # branches: [ release-4.0 ] | |
| 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: 'recursive' | |
| - name: Set up Pages | |
| id: pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
| - name: Set up Hugo | |
| uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0 | |
| with: | |
| hugo-version: '0.110.0' | |
| extended: true | |
| - name: Set up Node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: 18 | |
| - 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 }}/${{ env.doc_versionnumber }}/ | |
| # - name: Upload artifact | |
| # uses: actions/upload-pages-artifact@64bcae551a7b18bcb9a09042ddf1960979799187 # v1.0.8 | |
| # with: | |
| # path: ./public/ | |
| - name: Checkout code to update | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| 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 }} | |
| mkdir -p tmp/gh-pages/${{ env.doc_versionnumber }} | |
| mv public/* tmp/gh-pages/${{ env.doc_versionnumber }} | |
| - name: Commit & Push changes | |
| uses: actions-js/push@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| message: 'Publish updated docs for ${{ env.doc_versionnumber }}, ${{ github.event.repository.pushed_at}}' | |
| branch: 'gh-pages-test' | |
| directory: 'tmp/gh-pages' |