forgejo-ci: copy main's push workflow to public branch when deploying
This commit is contained in:
parent
ca8f37eb4b
commit
7c64f3ea04
2 changed files with 28 additions and 0 deletions
|
@ -25,6 +25,7 @@ jobs:
|
||||||
run: ikiwiki --setup ikiwiki.setup
|
run: ikiwiki --setup ikiwiki.setup
|
||||||
- name: Website upload
|
- name: Website upload
|
||||||
run: |
|
run: |
|
||||||
|
cp .forgejo/workflow/push.yaml public/.forgejo/workflow/.
|
||||||
git log -1 --pretty=%B > commit.txt
|
git log -1 --pretty=%B > commit.txt
|
||||||
cd public
|
cd public
|
||||||
date > generated.txt
|
date > generated.txt
|
||||||
|
|
27
.forgejo/workflows/push.yaml
Normal file
27
.forgejo/workflows/push.yaml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'public'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: x86_64
|
||||||
|
container: alpine:latest
|
||||||
|
env:
|
||||||
|
GIT_SSH_COMMAND: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
|
||||||
|
steps:
|
||||||
|
- name: Environment setup
|
||||||
|
run: |
|
||||||
|
apk add git nodejs openssh-client-common openssh-client-default
|
||||||
|
- name: Start ssh-agent
|
||||||
|
uses: https://github.com/webfactory/ssh-agent@v0.9.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.PAGES_PRIVKEY }}
|
||||||
|
- name: Repo pull
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Website upload
|
||||||
|
run: |
|
||||||
|
git remote set-url origin pages@ayakael.net:/var/lib/pages/ayakael.net
|
||||||
|
git push -f
|
Loading…
Reference in a new issue