feat: migrate from woodpecker to forgejo actions
Some checks failed
/ build (push) Failing after 7s
/ upload (push) Failing after 16s

This commit is contained in:
s3lph 2023-11-13 23:28:42 +01:00
parent 166afccf35
commit afe98b5eae
Signed by: s3lph
GPG key ID: 0AA29A52FB33CFB5
3 changed files with 39 additions and 29 deletions

View file

@ -0,0 +1,13 @@
---
on: push
jobs:
build:
runs-on: docker
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- run: |
pip install -r requirements.txt
./build.py

View file

@ -0,0 +1,26 @@
---
on:
push:
branches:
- main
jobs:
upload:
runs-on: docker
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- run: |
apt-get update
apt-get install --yes --no-install-recommends rsync openssh-client
pip3 install -r requirements.txt
./build.py
mkdir -p .ssh && chmod 0700 .ssh
cat > .ssh/id_ed25519 <<EOF
${{ secrets.SSH_PRIVATE_KEY }}
EOF
cat > .ssh/known_hosts <<EOF
${{ secrets.SSH_KNOWN_HOSTS }}
EOF
chmod 0600 ".ssh/id_ed25519"
rsync -v --recursive --delete -e "ssh -oUserKnownHostsFile=.ssh/known_hosts -i .ssh/id_ed25519" "out/" "${{ secrets.RSYNC_DEST }}"

View file

@ -1,29 +0,0 @@
---
pipeline:
build:
image: python:3.10-bullseye
commands:
- pip install -r requirements.txt
- ./build.py
upload:
image: python:3.10-bullseye
when:
branch: main
secrets:
- RSYNC_DEST
- SSH_KNOWN_HOSTS
- SSH_PRIVATE_KEY
commands:
- apt-get update
- apt-get install --yes --no-install-recommends rsync openssh-client
- pip3 install -r requirements.txt
- ./build.py
- export SSH_PRIVKEY_FILE=.ssh/id_ed25519
- export SSH_KNOWN_HOSTS_FILE=.ssh/known_hosts
- mkdir -p .ssh && chmod 0700 .ssh
- echo "$SSH_PRIVATE_KEY" > "$SSH_PRIVKEY_FILE"
- echo "$SSH_KNOWN_HOSTS" > "$SSH_KNOWN_HOSTS_FILE"
- chmod 0600 "$SSH_PRIVKEY_FILE"
- rsync -v --recursive --delete -e "ssh -oUserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE -i $SSH_PRIVKEY_FILE" "out/" "$RSYNC_DEST"