-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (64 loc) · 1.97 KB
/
start-site.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
63
64
65
name: Start Site
on:
workflow_dispatch:
inputs:
checkout_ref:
description: "Checkout reference of Xcratch"
default: "xcratch-published"
required: true
dev:
description: "Publish for development"
type: boolean
default: true
required: true
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Inputs
run: echo "${{ toJSON(inputs) }}"
- name: checkout scratch-gui
uses: actions/checkout@v4
with:
repository: xcratch/scratch-gui
ref: ${{ inputs.checkout_ref }}
path: ./scratch-gui
- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: ./scratch-gui/.nvmrc
- run: npm ci
working-directory: ./scratch-gui
- name: checkout xcratch.github.io
uses: actions/checkout@v4
with:
repository: xcratch/xcratch.github.io
path: ./xcratch.github.io
- name: build scratch-gui
run: npm run build
working-directory: ./scratch-gui
- run: cp ./xcratch.github.io/editor/favicon.ico ./scratch-gui/build/static/favicon.ico
- run: mv -T ./xcratch.github.io/public ./public
- run: mv -T ./scratch-gui/build ./public/editor
- name: checkout xcratch-doc
uses: actions/checkout@v4
with:
repository: xcratch/xcratch-doc
path: ./xcratch-doc
- run: mv -T ./xcratch-doc/docs ./public/docs
- name: publish for dev
if: ${{ inputs.dev }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
destination_dir: ./dev
keep_files: false
- name: publish
if: ${{ !inputs.dev }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
destination_dir: .
keep_files: true