-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.54 KB
/
deploy.yaml
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
name: Build and Deploy to GitHub Pages
on:
push:
branches:
- main # Set this to your default branch
env:
ACT: ${{ vars.ACT }}
jobs:
build-and-deploy:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Deploy to GitHub Pages
if: env.ACT != 'true'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build # Replace with your build output directory
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy to GitHub Pages'
- name: Simulate deployment (Act)
if: env.ACT == 'true'
run: |
echo "Simulating deployment to GitHub Pages"
echo "Contents of build directory:"
ls -R ./build # Replace './build' with your actual build directory
echo "In a real deployment, these files would be pushed to the gh-pages branch"
- name: Cleanup (Act)
if: env.ACT == 'true'
run: |
echo "Performing cleanup after Act simulation"
# Add any cleanup steps here, if necessary
# For example, removing build artifacts:
# rm -rf ./build