-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (40 loc) · 1.41 KB
/
ci.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
name: CI
on:
push:
branches:
- master
schedule:
- cron: "22 21 * * 1-5"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure git remote
run: git config --add remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
- name: Fetch gh-pages branch
run: git fetch origin gh-pages
- name: Checkout gh-pages branch
run: git checkout gh-pages
- name: Copy over generate.sh
run: git checkout master -- generate.sh
- name: Run generate.sh and cleanup
run: |
./generate.sh
rm generate.sh
- name: Generate sha256sums.txt
run: sha256sum -b *.txt > sha256sums.txt
- name: Run restore_last_git_modified_time.sh
run: curl -sL https://gist.github.com/HackingGate/9e8169c7645b074b2f40c959ca20d738/raw/3ae3913f308d9cf34962ac3488b5973a2fbe1a95/restore_last_git_modified_time.sh | sh
- name: Generate index.html
run: |
tree -I 'CNAME' -H '.' -L 1 -h -D --timefmt '%Y-%m-%d %H:%M:%S %Z' --noreport --charset utf-8 -T 'Country IP Blocks' -o index.html
sed -i "/\".\"/d" index.html
cat github-corner.html >> index.html
sed -i "s/your-url/github.com\/${GH_USER}\/${REPO}/g" index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .