generated from lkhrs/eleventy-simple
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (43 loc) · 1.69 KB
/
staticsite.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
name: Build and Publish
# Trigger this workflow only when the main branches, assets folder is modified.
on:
push:
branches: [ "main", "master" ]
paths-ignore:
- '**/README.md'
- '.github/workflows/playwright.yml'
- 'tests/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
deployments: write
jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build the static site
# If you use gists, generate a GH_GIST_TOKEN and add to repository action secrets.
# If GH_GIST_TOKEN doesn't exist, it's an unauthenticated call to Gist API...
# Unauthenticated call gets made to Gist API from Github Actions will result in rate limits and gists will fail to load.
# You can't use secrets.GITHUB_TOKEN either, as it's scoped to the repository and not the gists!
run: /bin/bash -c 'npm install;npm run build --gisttoken=${{ secrets.GH_GIST_TOKEN }} --githubtoken=${{ secrets.GITHUB_TOKEN }}'
- name: Setup Github Pages
uses: actions/configure-pages@v2
- name: Upload Github Pages artifact
uses: actions/upload-pages-artifact@v1
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1