-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (82 loc) · 2.58 KB
/
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
name: GitHub Pages
on:
push:
branches:
- master
pull_request:
branches:
- '**'
workflow_dispatch:
branches:
- '**'
jobs:
build:
if: |
!startsWith(github.event.head_commit.message, '[Skip CI]')
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-python@v2
with:
python-version: 3.x
- uses: actions/setup-node@v2
with:
node-version: 14.x
- run: make install
- run: make gh-pages/tarball
- uses: actions/upload-artifact@v2
with:
name: artifacts.tar.bz2
path: artifacts.tar.bz2
runs-on: ubuntu-latest
lint:
if: |
!startsWith(github.event.head_commit.message, '[Skip CI]')
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- run: |
sudo -H apt-get update && \
sudo -H apt-get install --yes libxml2-utils
- run: find . -type f -name '*.xml' | xargs xmllint --noout
runs-on: ubuntu-latest
deploy:
needs:
- build
- lint
if: |
github.ref == 'refs/heads/master' &&
github.event_name != 'pull_request' &&
!startsWith(github.event.head_commit.message, '[Skip Deploy]')
steps:
- uses: actions/download-artifact@v2
with:
name: artifacts.tar.bz2
- run: tar --extract --bzip2 --verbose --file=artifacts.tar.bz2
- run: |
mkdir --parent /tmp/deploy
rsync --delete --links --recursive --verbose gh-pages/ /tmp/deploy
- run: |
git init
git checkout --orphan gh-pages
git config user.email "[email protected]"
git config user.name "Ashen Gunaratne"
git add --all --force .
git commit --quiet --message "Deploy ashenm/xmlresume to github.com/${GITHUB_REPOSITORY}.git:gh-pages"
git push --force --quiet "https://${{ secrets.OCTOCAT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" "gh-pages:gh-pages"
git show --stat-count=10 HEAD
working-directory: /tmp/deploy
runs-on: ubuntu-latest
culminate:
needs:
- deploy
steps:
- run: |
# ashenm/homepage
curl --fail --request POST --header "Accept: application/vnd.github.v3+json" --header "Authorization: token ${OCTOCAT_TOKEN}" --data "{ \"ref\": \"master\" }" --url "https://api.github.com/repos/ashenm/homepage/actions/workflows/pages.yml/dispatches"
env:
OCTOCAT_TOKEN: ${{ secrets.OCTOCAT_TOKEN }}
runs-on: ubuntu-latest
# vim: set expandtab shiftwidth=2: