-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.11 KB
/
build-and-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and deploy danieletabellini 11ty pages
on:
push:
branches: ['main']
# pull_request:
# branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies & build
run: |
# npm ci
npm install
npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./_site
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure GitHub Pages
uses: actions/configure-pages@v3.0.5
with:
# Optional static site generator to attempt to configure: "nuxt", "next", "gatsby", or "sveltekit"
# static_site_generator: # optional
# Optional file path to static site generator configuration file
# generator_config_file: # optional
# GitHub token
token: ${{ secrets.GITHUB_TOKEN }}
# Try to enable Pages for the repository if it is not already enabled.
# This option requires a token other than `GITHUB_TOKEN` to be provided.
# In the context of a Personal Access Token, the `repo` scope or Pages
# write permission is required. In the context of a GitHub App, the
# `administration:write` and `pages:write` permissions are required.
# enablement: # optional, default is false
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v1.0.8
with:
name: github-pages
path: ./_site
# retention-days: # optional, default is 1
- name: Deploy GitHub Pages site
uses: actions/deploy-pages@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: github-pages