-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.52 KB
/
static.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
# Workflow name
name: Deploy static content to Pages
# Trigger conditions: push to the devchat-styles branch or manually trigger
on:
push:
branches: ["main"]
workflow_dispatch:
# Set the permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Set concurrency: only allow one deployment at a time, skip runs queued between the run in progress and the latest queued run
concurrency:
group: "pages"
cancel-in-progress: false
# Define jobs
jobs:
deploy:
# Set environment variables
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Set the running environment
runs-on: ubuntu-latest
# Define steps
steps:
# Checkout code
- name: Checkout
uses: actions/checkout@v3
# Set up Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
# Install dependencies and build the project
- name: Install dependencies and build
run: |
npm ci
npm run generate
# Set up Pages
- name: Setup Pages
uses: actions/configure-pages@v3
# Upload build artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Set the path of the build artifact to 'dist'
path: 'dist'
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2