|
| 1 | +name: Publish version 4.11 |
| 2 | + |
| 3 | +env: |
| 4 | + doc_versionnumber: "4.11" |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - release-4.11 |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + name: Build |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + permissions: |
| 18 | + contents: write |
| 19 | + pages: write |
| 20 | + id-token: write |
| 21 | + |
| 22 | + concurrency: |
| 23 | + group: "pages" |
| 24 | + cancel-in-progress: false |
| 25 | + |
| 26 | + environment: |
| 27 | + name: github-pages-test |
| 28 | + url: ${{ steps.deployment.outputs.page_url }} |
| 29 | + |
| 30 | + steps: |
| 31 | + - name: Checkout code |
| 32 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 33 | + with: |
| 34 | + ref: release-4.11 |
| 35 | + submodules: 'recursive' |
| 36 | + |
| 37 | + - name: Set up Pages |
| 38 | + id: pages |
| 39 | + uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0 |
| 40 | + |
| 41 | + - name: Set up Hugo |
| 42 | + uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d # v2.6.0 |
| 43 | + with: |
| 44 | + hugo-version: '0.110.0' |
| 45 | + extended: true |
| 46 | + |
| 47 | + - name: Set up Node |
| 48 | + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 |
| 49 | + with: |
| 50 | + node-version: 18 |
| 51 | + |
| 52 | + - name: Install dependencies |
| 53 | + run: | |
| 54 | + cd themes/docsy |
| 55 | + npm install |
| 56 | +
|
| 57 | + - name: Set up PostCSS |
| 58 | + run: npm install --save-dev autoprefixer postcss-cli postcss |
| 59 | + |
| 60 | + - name: Build |
| 61 | + run: hugo --environment production --baseURL ${{ steps.pages.outputs.base_url }}/${{ env.doc_versionnumber }}/ |
| 62 | + |
| 63 | + # - name: Upload artifact |
| 64 | + # uses: actions/upload-pages-artifact@64bcae551a7b18bcb9a09042ddf1960979799187 # v1.0.8 |
| 65 | + # with: |
| 66 | + # path: ./public/ |
| 67 | + |
| 68 | + - name: Checkout code to update |
| 69 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 70 | + with: |
| 71 | + ref: 'gh-pages-test' |
| 72 | + path: 'tmp/gh-pages' |
| 73 | + # - name: Display file structure |
| 74 | + # run: ls -R |
| 75 | + - name: Copy built site to GH pages |
| 76 | + run: | |
| 77 | + rm -rf tmp/gh-pages/${{ env.doc_versionnumber }} |
| 78 | + mkdir -p tmp/gh-pages/${{ env.doc_versionnumber }} |
| 79 | + mv public/* tmp/gh-pages/${{ env.doc_versionnumber }} |
| 80 | + - name: Commit & Push changes |
| 81 | + uses: actions-js/push@master |
| 82 | + with: |
| 83 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + message: 'Publish updated docs for ${{ env.doc_versionnumber }}, ${{ github.event.repository.pushed_at}}' |
| 85 | + branch: 'gh-pages-test' |
| 86 | + directory: 'tmp/gh-pages' |
0 commit comments