|
6 | 6 | push: |
7 | 7 | branches: |
8 | 8 | - main |
9 | | - schedule: |
10 | | - - cron: 0 20 * * * |
11 | | - |
12 | | -permissions: |
13 | | - contents: write |
14 | 9 |
|
15 | 10 | jobs: |
16 | | - build-deploy: |
| 11 | + build: |
17 | 12 | runs-on: ubuntu-latest |
| 13 | + env: |
| 14 | + HUGO_VERSION: 0.111.0 |
18 | 15 | steps: |
19 | | - - name: Checkout Repo |
| 16 | + - name: Install Hugo CLI |
| 17 | + run: | |
| 18 | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ |
| 19 | + && sudo dpkg -i ${{ runner.temp }}/hugo.deb |
| 20 | + - name: Install Dart Sass |
| 21 | + run: sudo snap install dart-sass |
| 22 | + - name: Checkout |
20 | 23 | uses: actions/checkout@v4 |
21 | 24 | with: |
22 | 25 | submodules: recursive |
23 | 26 | fetch-depth: 0 |
24 | | - - name: Install Go |
25 | | - uses: actions/setup-go@v5 |
26 | | - with: |
27 | | - go-version-file: go.mod |
28 | | - - name: Setup Hugo |
29 | | - uses: peaceiris/actions-hugo@v3 |
30 | | - with: |
31 | | - hugo-version: '0.111.0' |
32 | | - extended: true |
33 | | - - name: Install deps |
| 27 | + - name: Setup Pages |
| 28 | + id: pages |
| 29 | + uses: actions/configure-pages@v5 |
| 30 | + - name: Install Node.js dependencies |
| 31 | + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" |
| 32 | + - name: Install npm dependencies |
34 | 33 | run: | |
35 | | - npm install postcss-cli |
36 | | - npm install autoprefixer |
37 | | - - name: Build package docs |
| 34 | + npm install postcss-cli |
| 35 | + npm install autoprefixer |
| 36 | + - name: Build with Hugo |
| 37 | + env: |
| 38 | + HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache |
| 39 | + HUGO_ENVIRONMENT: production |
38 | 40 | run: | |
39 | 41 | make BASE_URL=https://rancher.github.io/elemental-toolkit build-docs |
40 | | - - name: Deploy |
41 | | - if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
42 | | - uses: JamesIves/github-pages-deploy-action@v4 |
| 42 | + - name: Upload artifact |
| 43 | + uses: actions/upload-pages-artifact@v3 |
43 | 44 | with: |
44 | | - branch: gh-pages |
45 | | - folder: public |
| 45 | + path: ./public |
46 | 46 |
|
| 47 | + deploy: |
| 48 | + permissions: |
| 49 | + pages: write |
| 50 | + id-token: write |
| 51 | + environment: |
| 52 | + name: gh-pages |
| 53 | + url: ${{ steps.deployment.outputs.page_url }} |
| 54 | + runs-on: ubuntu-latest |
| 55 | + needs: build |
| 56 | + steps: |
| 57 | + - name: Deploy to GitHub Pages |
| 58 | + if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
| 59 | + id: deployment |
| 60 | + uses: actions/deploy-pages@v4 |
0 commit comments