|
2 | 2 | name: Deploy example site to GitHub Pages
|
3 | 3 |
|
4 | 4 | on:
|
5 |
| - # Triggers the workflow on push to any tags |
6 |
| - push: |
7 |
| - tags: |
8 |
| - - '*' |
| 5 | + # Triggers the workflow on push to any tags |
| 6 | + push: |
| 7 | + tags: |
| 8 | + - "*" |
9 | 9 |
|
10 | 10 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
11 | 11 | permissions:
|
12 |
| - contents: read |
13 |
| - pages: write |
14 |
| - id-token: write |
| 12 | + contents: read |
| 13 | + pages: write |
| 14 | + id-token: write |
15 | 15 |
|
16 | 16 | # Allow one concurrent deployment
|
17 | 17 | concurrency:
|
18 |
| - group: "pages" |
19 |
| - cancel-in-progress: true |
| 18 | + group: "pages" |
| 19 | + cancel-in-progress: true |
20 | 20 |
|
21 | 21 | # Default to bash
|
22 | 22 | defaults:
|
23 |
| - run: |
24 |
| - shell: bash |
| 23 | + run: |
| 24 | + shell: bash |
25 | 25 |
|
26 | 26 | jobs:
|
27 |
| - # Build job |
28 |
| - build: |
29 |
| - runs-on: ubuntu-latest |
30 |
| - env: |
31 |
| - HUGO_VERSION: 0.112.0 |
32 |
| - steps: |
33 |
| - - name: Install Hugo CLI |
34 |
| - run: | |
35 |
| - wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ |
36 |
| - && sudo dpkg -i ${{ runner.temp }}/hugo.deb |
37 |
| - - name: Install Dart Sass Embedded |
38 |
| - run: sudo snap install dart-sass-embedded |
39 |
| - - name: Checkout |
40 |
| - uses: actions/checkout@v3 |
41 |
| - with: |
42 |
| - submodules: recursive |
43 |
| - fetch-depth: 0 |
44 |
| - ref: 'example-site' |
45 |
| - - name: Setup Pages |
46 |
| - id: pages |
47 |
| - uses: actions/configure-pages@v3 |
48 |
| - - name: Install Theme |
49 |
| - run: mkdir themes && cd themes && git clone https://github.com/JingWangTW/dark-theme-editor.git |
50 |
| - - name: Build with Hugo |
| 27 | + # Build job |
| 28 | + build: |
| 29 | + runs-on: ubuntu-latest |
51 | 30 | env:
|
52 |
| - # For maximum backward compatibility with Hugo modules |
53 |
| - HUGO_ENVIRONMENT: production |
54 |
| - HUGO_ENV: production |
55 |
| - run: | |
56 |
| - hugo \ |
57 |
| - --minify \ |
58 |
| - --enableGitInfo \ |
59 |
| - --baseURL "${{ steps.pages.outputs.base_url }}/" |
60 |
| - - name: Upload artifact |
61 |
| - uses: actions/upload-pages-artifact@v1 |
62 |
| - with: |
63 |
| - path: ./public |
| 31 | + HUGO_VERSION: 0.124.0 |
| 32 | + steps: |
| 33 | + - name: Install Hugo CLI |
| 34 | + run: | |
| 35 | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ |
| 36 | + && sudo dpkg -i ${{ runner.temp }}/hugo.deb |
| 37 | + - name: Install Dart Sass Embedded |
| 38 | + run: sudo snap install dart-sass-embedded |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v3 |
| 41 | + with: |
| 42 | + submodules: recursive |
| 43 | + fetch-depth: 0 |
| 44 | + ref: "example-site" |
| 45 | + - name: Setup Pages |
| 46 | + id: pages |
| 47 | + uses: actions/configure-pages@v3 |
| 48 | + - name: Install Theme |
| 49 | + run: mkdir themes && cd themes && git clone https://github.com/JingWangTW/dark-theme-editor.git |
| 50 | + - name: Build with Hugo |
| 51 | + env: |
| 52 | + # For maximum backward compatibility with Hugo modules |
| 53 | + HUGO_ENVIRONMENT: production |
| 54 | + HUGO_ENV: production |
| 55 | + run: | |
| 56 | + hugo \ |
| 57 | + --minify \ |
| 58 | + --enableGitInfo \ |
| 59 | + --baseURL "${{ steps.pages.outputs.base_url }}/" |
| 60 | + - name: Upload artifact |
| 61 | + uses: actions/upload-pages-artifact@v1 |
| 62 | + with: |
| 63 | + path: ./public |
64 | 64 |
|
65 |
| - # Deployment job |
66 |
| - deploy: |
67 |
| - environment: |
68 |
| - name: github-pages |
69 |
| - url: ${{ steps.deployment.outputs.page_url }} |
70 |
| - runs-on: ubuntu-latest |
71 |
| - needs: build |
72 |
| - steps: |
73 |
| - - name: Deploy to GitHub Pages |
74 |
| - id: deployment |
75 |
| - uses: actions/deploy-pages@v1 |
| 65 | + # Deployment job |
| 66 | + deploy: |
| 67 | + environment: |
| 68 | + name: github-pages |
| 69 | + url: ${{ steps.deployment.outputs.page_url }} |
| 70 | + runs-on: ubuntu-latest |
| 71 | + needs: build |
| 72 | + steps: |
| 73 | + - name: Deploy to GitHub Pages |
| 74 | + id: deployment |
| 75 | + uses: actions/deploy-pages@v1 |
0 commit comments