-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 2.05 KB
/
deploy-github-pages.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Deploy Github Pages
on:
push:
branches:
- main
workflow_dispatch: {}
# on: workflow_dispatch
jobs:
build-pages:
runs-on: ubuntu-latest
steps:
- name: Check out main repo
uses: actions/checkout@v3
- name: Check out userscript-common
uses: actions/checkout@v3
with:
repository: owowed/userscript-common
path: public/common
- name: Check out owowed-userscripts
uses: actions/checkout@v3
with:
repository: owowed/owowed-userscripts
path: public/scripts
- name: Git leftovers cleanup
run: |
find public -type d -name ".git" -exec rm -rf {} +
find public -type d -name ".github" -exec rm -rf {} +
- name: Generate Directory Listings
uses: jayanta525/[email protected]
with:
FOLDER: public
- name: Upload github-pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: public
- name: Run tree
run: tree
publish:
needs: build-pages
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
publish-branch:
needs: build-pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download github-pages artifact
uses: actions/download-artifact@v3
with:
name: github-pages
path: public
- name: Extract github-pages tar
run: |
tar -xvf public/artifact.tar -C public
rm public/artifact.tar
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
with:
fqdn: userjs.owowed.moe
target_branch: gh-pages
build_dir: public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}