-
Notifications
You must be signed in to change notification settings - Fork 355
57 lines (50 loc) · 1.37 KB
/
deploy.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
name: Deploy gh-pages
on:
push:
branches:
- master
paths:
- .github/workflows/deploy.yml
- common/**
- examples/**
- img/**
- aria-practices.html
- README.md
jobs:
deploy:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
steps:
- uses: actions/checkout@v2
with:
path: main
- uses: actions/checkout@v2
with:
path: deploy
ref: gh-pages
token: ${{ env.GH_TOKEN }}
- name: Cleanup old files
run: |
rm -rf deploy/common/
rm -rf deploy/examples/
rm -rf deploy/img/
rm -rf deploy/index.html
rm -rf deploy/README.md
- name: Copy files
run: |
cp -R main/common deploy
cp -R main/examples deploy
cp -R main/img deploy
cp main/README.md deploy
- name: Generate new index
run: |
curl "https://labs.w3.org/spec-generator/?type=respec&url=https://raw.githack.com/${{ github.repository }}/${{ github.sha }}/aria-practices.html" -o deploy/index.html -f --retry 3
- name: Commit back
run: |
cd deploy
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add --all
git commit -am "Generated by ${{ github.sha }}" || true
git push