-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (60 loc) · 2.01 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
name: Pages
on:
schedule:
- cron: "0 0,12 * * *"
workflow_dispatch:
jobs:
pages:
runs-on: ubuntu-latest
container: node:lts-alpine
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
apk update
apk add brotli curl git grep jq xmlstarlet
- name: Build
env:
PHISHTANK_API: ${{ secrets.PHISHTANK_API }}
CF_API: ${{ secrets.CF_API }}
run: sh src/script.sh
- name: Compress
run: |
find public -type f -regex '.*\.\(txt\|conf\|tpl\|rules\|csv\)$' -exec gzip -f -k -9 {} \;
find public -type f -regex '.*\.\(txt\|conf\|tpl\|rules\|csv\)$' -exec brotli -f -k -9 {} \;
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
force_orphan: true
- name: "Upload Public Folder"
uses: actions/upload-artifact@v4
with:
name: public
path: ./public
retention-days: 30
- name: "Upload Tmp Folder"
uses: actions/upload-artifact@v4
with:
name: tmp
path: ./tmp
retention-days: 30
- name: Check GitLab Status
env:
GITHUB_ENV: ${{ env.GITHUB_ENV }}
run: sh ./src/gitlab_status.sh
- name: Cloudflare Pages
env:
CLOUDFLARE_BUILD_HOOK: ${{ secrets.CLOUDFLARE_BUILD_HOOK }}
if: ${{ env.CLOUDFLARE_BUILD_HOOK != 0 && env.GITLAB_STATUS == 'down' }}
run: curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/${{ env.CLOUDFLARE_BUILD_HOOK }}"
- name: Netlify
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
if: ${{ env.NETLIFY_SITE_ID != 0 && env.GITLAB_STATUS == 'down' }}
run: |
npm install netlify-cli -g
netlify --telemetry-disable
netlify deploy --dir=public --prod