Skip to content

Commit 15a090a

Browse files
committed
CI: add workflow to update antenna page
1 parent f56c791 commit 15a090a

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/update.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Update Antenna page
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *'
6+
push:
7+
branches:
8+
- master
9+
- gh-actions # ToDo: remove
10+
paths-ignore:
11+
- 'README.md'
12+
- 'CHANGELOG.md'
13+
- 'LICENSE'
14+
- '.gitignore'
15+
16+
jobs:
17+
build:
18+
name: ${{ matrix.os }}
19+
runs-on: ubuntu-18.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
ghc: ["8.8.4"]
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Cache .stack
29+
id: cache-stack
30+
uses: actions/cache@v2
31+
with:
32+
path: ~/.stack
33+
key: "\
34+
${{ runner.os }}-stack\
35+
-${{ hashFiles('**/stack.yaml.lock') }}\
36+
-${{ hashFiles('**/package.yaml') }}\
37+
"
38+
restore-keys: |
39+
${{ runner.os }}-stack-
40+
- uses: actions/setup-haskell@v1.1.4
41+
name: Setup Haskell
42+
with:
43+
ghc-version: ${{ matrix.ghc }}
44+
enable-stack: true
45+
stack-version: 'latest'
46+
47+
- name: Install dependencies
48+
run: stack --system-ghc build --only-dependencies
49+
50+
- name: Build
51+
run: stack --system-ghc install
52+
53+
- uses: actions/checkout@v2
54+
ref: 'gh-pages'
55+
path: 'temp'
56+
57+
- name: Exec Application
58+
run: |
59+
cp sites.yaml temp/sites.yaml
60+
cp -r image/* temp/image
61+
cd temp && antenna sites.yaml
62+
63+
- name: Push changes
64+
run: |
65+
git config --local user.email "bot@example.com"
66+
git config --local user.name "Bot"
67+
git status
68+
git add -A
69+
git diff --staged --quiet || git commit -m "[skip ci] Update planet haskell. See https://haskell.jp/antenna/ for new entries!"
70+
git push origin gh-pages
71+
working-directory: ./temp

0 commit comments

Comments
 (0)