-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·42 lines (40 loc) · 1.44 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
name: Publish to GitHub pages
on:
push:
branches:
- main
jobs:
publish-pages:
environment:
name: Publish website
url: https://wdes.fr
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_KEY_DEPLOY }}
- name: Import GPG key
# v5.2.0 - 111c56156bcc6918c056dbef52164cfa583dc549
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Build and push
run: |
set -o xtrace
make build
TEMP_DIR="$(mktemp -d --suffix=_website_williamdes)"
cp -rp wdes.fr/public "${TEMP_DIR}"
git checkout gh-pages
git ls-files | xargs -r -n 1 rm
rm -rfd ./*
mv "${TEMP_DIR}"/public/* ./
rm -rf "${TEMP_DIR}"
echo 'wdes.fr' > CNAME
git add -A
git commit --allow-empty -m "Content update ($(date --utc))"
git push