-
-
Notifications
You must be signed in to change notification settings - Fork 13
54 lines (45 loc) · 1.59 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
45
46
47
48
49
50
51
52
53
54
name: Update repo
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip-ci')"
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install build requirements
run: sudo apt-get -y install lz4
- name: Get commit SHA
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=sha_short::$(git rev-parse HEAD)"
- name: Import GPG Keys
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.PALERA1N_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PALERA1N_GPG_PASSPHRASE }}
- name: Build repo
run: |
bash build.sh
- name: Upload files
uses: wangyucode/[email protected]
with:
host: ${{ secrets.REPO_FTP_HOST }}
port: ${{ secrets.REPO_FTP_PORT }}
username: repo
password: ${{ secrets.REPO_FTP_PASS }}
forceUpload: true
dryRun: false
localDir: 'publish/'
remoteDir: '/files'
- name: Purge Cloudflare cache
run: |
curl -X POST https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/purge_cache -H 'Authorization: Bearer ${{ secrets.CF_API_TOKEN }}' -H 'Content-Type: application/json' --data '{"purge_everything": true}'