Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit b5ce130

Browse files
committed
Add GH actions to build & publish
1 parent bc99b02 commit b5ce130

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Publish
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["master"]
7+
paths-ignore:
8+
- ".github/**"
9+
- "!.github/workflows/**"
10+
pull_request:
11+
branches: ["master"]
12+
13+
jobs:
14+
Build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
# ---
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
# ---
21+
- name: Setup NodeJS
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: "npm"
26+
cache-dependency-path: package-lock.json
27+
# ---
28+
- name: Install
29+
id: install-step
30+
run: |
31+
npm ci --cache npm --prefer-offline
32+
# ---
33+
- name: Build
34+
id: build-step
35+
run: |
36+
npx nuxt build --preset github_pages
37+
# ---
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: ./.output/public
42+
43+
Publish:
44+
runs-on: ubuntu-latest
45+
if: github.ref == 'refs/heads/master'
46+
needs: build
47+
permissions:
48+
pages: write
49+
id-token: write
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
# ---
55+
- name: Publish to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)