-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.64 KB
/
Copy pathdeploy.yml
File metadata and controls
56 lines (52 loc) · 1.64 KB
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: Deploy to GitHub Pages
on:
push:
branches:
- main
pull_request:
branches:
- main # Adjust if your PR targets a different branch
permissions:
contents: write
statuses: write # For reporting commit statuses
checks: write # For updating PR checks
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: retail-DAO-docs/package-lock.json
- name: Install dependencies
run: npm install
working-directory: ./retail-DAO-docs
- name: Build website
run: npm run build
working-directory: ./retail-DAO-docs
- name: Report Build Status
if: always() # Run even if build fails
uses: actions/github-script@v6
with:
script: |
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: "${{ job.status }}",
context: "report-build-status",
description: "Build and test status"
});
- name: Deploy to GitHub Pages
if: github.event_name == 'push' # Only deploy on push to main
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./retail-DAO-docs/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com