Add .forgejo/workflows/deploy.yaml
Signed-off-by: xengi <cccb-git@xengi.de>
This commit is contained in:
parent
9864b78c61
commit
b1e883a337
1 changed files with 46 additions and 0 deletions
46
.forgejo/workflows/deploy.yaml
Normal file
46
.forgejo/workflows/deploy.yaml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
name: deploy blog
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- staging
|
||||||
|
- production
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: some-runner
|
||||||
|
secrets:
|
||||||
|
SSH_PRIVATE_KEY: keep_it_private
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
ref: forgejo.ref
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: 'stable'
|
||||||
|
- run: go version
|
||||||
|
- run: go install github.com/gohugoio/hugo@latest
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v6
|
||||||
|
with:
|
||||||
|
python-version-file: '.python-version'
|
||||||
|
- run: python --version
|
||||||
|
- run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Render site
|
||||||
|
run: ./build.sh
|
||||||
|
|
||||||
|
- name: Setup SSH key
|
||||||
|
run: |
|
||||||
|
echo ${{ secrets.SSH_PRIVATE_KEY }} > id_ed25519
|
||||||
|
chmod 600 id_ed25519
|
||||||
|
- name: Sync rendered site to staging
|
||||||
|
if: forgejo.ref == 'refs/heads/staging'
|
||||||
|
run: rsync -var -e 'ssh -i id_ed25519' ./public/ deploy@www.berlin.ccc.de:srv/http/www-staging/
|
||||||
|
continue-on-error: true
|
||||||
|
- name: Sync rendered site to production
|
||||||
|
if: forgejo.ref == 'refs/heads/production'
|
||||||
|
run: rsync -var -e 'ssh -i id_ed25519' ./public/ deploy@www.berlin.ccc.de:srv/http/www/
|
||||||
|
continue-on-error: true
|
||||||
|
- name: Cleanup
|
||||||
|
run: rm -rf id_ed25519
|
||||||
Loading…
Add table
Add a link
Reference in a new issue