|
1 | 1 | name: Deploy to Pages |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - 2.x |
7 | | - workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 2.x |
| 7 | + workflow_dispatch: |
8 | 8 | permissions: |
9 | | - contents: read |
10 | | - pages: write |
11 | | - id-token: write |
| 9 | + contents: read |
| 10 | + pages: write |
| 11 | + id-token: write |
12 | 12 | concurrency: |
13 | | - group: "pages" |
14 | | - cancel-in-progress: false |
| 13 | + group: "pages" |
| 14 | + cancel-in-progress: false |
15 | 15 | defaults: |
16 | | - run: |
17 | | - shell: bash |
| 16 | + run: |
| 17 | + shell: bash |
18 | 18 | jobs: |
19 | | - build: |
20 | | - runs-on: ubuntu-latest |
| 19 | + build: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + env: |
| 22 | + HUGO_VERSION: 0.152.0 |
| 23 | + steps: |
| 24 | + - name: Install Hugo CLI |
| 25 | + run: | |
| 26 | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ |
| 27 | + && sudo dpkg -i ${{ runner.temp }}/hugo.deb |
| 28 | + - name: Install Dart Sass |
| 29 | + run: sudo snap install dart-sass |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + submodules: recursive |
| 34 | + fetch-depth: 0 |
| 35 | + - name: Setup Node.js |
| 36 | + uses: actions/setup-node@v4 |
| 37 | + with: |
| 38 | + node-version: '20' |
| 39 | + cache: 'npm' |
| 40 | + cache-dependency-path: docs/package-lock.json |
| 41 | + - name: Setup Pages |
| 42 | + id: pages |
| 43 | + uses: actions/configure-pages@v4 |
| 44 | + - name: Install dependencies |
| 45 | + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" |
| 46 | + working-directory: ./docs |
| 47 | + - name: Build production website |
21 | 48 | env: |
22 | | - HUGO_VERSION: 0.152.0 |
23 | | - steps: |
24 | | - - name: Install Hugo CLI |
25 | | - run: | |
26 | | - wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ |
27 | | - && sudo dpkg -i ${{ runner.temp }}/hugo.deb |
28 | | - - name: Install Dart Sass |
29 | | - run: sudo snap install dart-sass |
30 | | - - name: Checkout |
31 | | - uses: actions/checkout@v4 |
32 | | - with: |
33 | | - submodules: recursive |
34 | | - fetch-depth: 0 |
35 | | - - name: Setup Node.js |
36 | | - uses: actions/setup-node@v4 |
37 | | - with: |
38 | | - node-version: '20' |
39 | | - cache: 'npm' |
40 | | - cache-dependency-path: docs/package-lock.json |
41 | | - - name: Setup Pages |
42 | | - id: pages |
43 | | - uses: actions/configure-pages@v4 |
44 | | - - name: Install dependencies |
45 | | - run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" |
46 | | - working-directory: ./docs |
47 | | - - name: Build production website |
48 | | - env: |
49 | | - HUGO_ENVIRONMENT: production |
50 | | - HUGO_ENV: production |
51 | | - TZ: America/Toronto |
52 | | - run: | |
53 | | - npm run build \ |
54 | | - -- \ |
55 | | - --baseURL "https://backslashphp.github.io/" |
56 | | - working-directory: ./docs |
57 | | - - name: Copy to backslashphp/backslashphp.github.io |
58 | | - uses: peaceiris/actions-gh-pages@v4 |
59 | | - with: |
60 | | - personal_token: ${{ secrets.DEPLOY_TOKEN }} |
61 | | - external_repository: backslashphp/backslashphp.github.io |
62 | | - publish_branch: main |
63 | | - publish_dir: ./docs/public |
64 | | - cname: backslashphp.github.io |
65 | | - user_name: 'github-actions[bot]' |
66 | | - user_email: 'github-actions[bot]@users.noreply.github.com' |
| 49 | + HUGO_ENVIRONMENT: production |
| 50 | + HUGO_ENV: production |
| 51 | + TZ: America/Toronto |
| 52 | + run: | |
| 53 | + npm run build \ |
| 54 | + -- \ |
| 55 | + --baseURL "https://backslashphp.github.io/" |
| 56 | + working-directory: ./docs |
| 57 | + - name: Copy to backslashphp/backslashphp.github.io |
| 58 | + uses: peaceiris/actions-gh-pages@v4 |
| 59 | + with: |
| 60 | + personal_token: ${{ secrets.DEPLOY_TOKEN }} |
| 61 | + external_repository: backslashphp/backslashphp.github.io |
| 62 | + publish_branch: main |
| 63 | + publish_dir: ./docs/public |
| 64 | + cname: backslashphp.github.io |
| 65 | + user_name: 'github-actions[bot]' |
| 66 | + user_email: 'github-actions[bot]@users.noreply.github.com' |
0 commit comments