feat: migrate from woodpecker to forgejo actions
This commit is contained in:
parent
166afccf35
commit
afe98b5eae
3 changed files with 39 additions and 29 deletions
13
.forgejo/workflows/build.yml
Normal file
13
.forgejo/workflows/build.yml
Normal 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
|
||||
|
26
.forgejo/workflows/upload.yml
Normal file
26
.forgejo/workflows/upload.yml
Normal 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 }}"
|
|
@ -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"
|
Loading…
Reference in a new issue