Skip to content

Commit

Permalink
Improve publish
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Jun 19, 2024
1 parent 97b0f0f commit 29d3a60
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Publish to GitHub pages
name: Publish to git to static pages

permissions:
contents: none

on:
push:
Expand All @@ -15,11 +18,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_KEY_DEPLOY }}
fetch-depth: 1
token: ${{ secrets.SUDO_BOT_TOKEN }}
# Already the default value, but so you understand the push command will have creds
persist-credentials: true
- name: Import GPG key
# v5.2.0 - 111c56156bcc6918c056dbef52164cfa583dc549
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
# v6.1.0 - 01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
Expand All @@ -31,12 +36,11 @@ jobs:
make build
TEMP_DIR="$(mktemp -d --suffix=_website_williamdes)"
cp -rp williamdes.eu/public "${TEMP_DIR}"
git checkout gh-pages
git ls-files | xargs -r -n 1 rm
git checkout static-pages
git ls-files | xargs -r -n 1 rm -vf
rm -rfd ./*
mv "${TEMP_DIR}"/public/* ./
rm -rf "${TEMP_DIR}"
echo 'williamdes.eu' > CNAME
git add -A
git commit --allow-empty -m "Content update ($(date --utc))"
git push

0 comments on commit 29d3a60

Please sign in to comment.