-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.11 KB
/
publish.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
name: Publish
on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.MARK_KEEP_ALIVE }}
fetch-depth: "0"
- name: Create buildout
run: |
payload=$(curl -s https://random-data-api.com/api/nation/random_nation)
nat=$(echo $payload | jq -r '.nationality')
sport=$(echo $payload | jq -r '.national_sport')
mkdir buildout
sed "s/@nationality/$nat/g" index.html > buildout/index.html
sed "s/@sport/$sport/g" -i buildout/index.html
echo "$(date +'%m/%d/%Y') $nat" >> log
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add log
git commit -m "Rotate"
git push
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.MARK_KEEP_ALIVE }}
publish_branch: gh-pages
cname: whoismark.today
publish_dir: ./buildout