-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.32 KB
/
website.yml
File metadata and controls
52 lines (43 loc) · 1.32 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
name: Deploy GitHub Pages
on:
push:
branches:
- main # Adjust if you track a different branch in EmulatorWeb/EmulatorWeb
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- name: Checkout Main Repository (emulatorweb.github.io)
uses: actions/checkout@v2
with:
repository: EmulatorWeb/emulatorweb.github.io
path: main-repo
- name: Checkout Website Code Repository (EmulatorWeb)
uses: actions/checkout@v2
with:
repository: EmulatorWeb/EmulatorWeb
path: emulatorweb
- name: Set Up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install Dependencies
run: |
cd emulatorweb
npm install
- name: Build Static Files
run: |
cd emulatorweb
node build.js
- name: Copy Built Files to Main Repository
run: |
Remove-Item -Recurse -Force main-repo\* # Remove all contents in main-repo root
Copy-Item -Recurse -Force emulatorweb\dist\* main-repo\ # Copy built files to root of main-repo
- name: Commit and Push Changes
run: |
cd main-repo
git add .
git commit -m "Update GitHub Pages from EmulatorWeb" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}