git/.forgejo/workflows/main.yaml

49 lines
1.1 KiB
YAML
Raw Normal View History

2024-03-22 15:10:04 +00:00
on: [push]
jobs:
job:
runs-on: docker
container:
image: debian:bookworm
steps:
2024-03-22 22:15:17 +00:00
- name: Clone CD
2024-03-22 15:10:04 +00:00
run: |
echo '${{vars.dns}}' > '/etc/resolv.conf'
2024-03-22 22:15:17 +00:00
apt-get update
apt-get install --yes 'git'
2024-03-22 22:29:34 +00:00
git clone "${GITHUB_SERVER_URL}/rwx.work/cd" '/cd'
2024-03-22 15:10:04 +00:00
2024-03-22 22:38:49 +00:00
- run: /cd/env
2024-03-22 15:10:04 +00:00
2024-03-22 22:38:49 +00:00
- run: /cd/workspace
2024-03-22 22:21:46 +00:00
2024-03-22 15:10:04 +00:00
- name: Install tools
run: |
2024-03-22 22:15:17 +00:00
apt-get install --yes \
2024-03-22 15:15:15 +00:00
'pandoc' \
2024-03-22 15:10:04 +00:00
'rsync' \
2024-03-22 22:38:49 +00:00
- run: /cd/branch
2024-03-22 15:10:04 +00:00
- name: Build
run: './build.sh'
- name: Configure Delivery
run: |
mkdir --parents ~/.ssh
2024-03-22 15:29:48 +00:00
echo '${{secrets.cd}}' > ~/.ssh/id_ed25519
2024-03-22 15:10:04 +00:00
chmod 600 ~/.ssh/id_ed25519
sha256sum ~/.ssh/id_ed25519
- name: Test connection
2024-03-22 19:48:33 +00:00
run: |
2024-03-22 19:55:15 +00:00
ssh -o StrictHostKeyChecking=accept-new 'cd@de.tilde.link' \
2024-03-22 19:48:33 +00:00
-- hostname
2024-03-22 15:10:04 +00:00
- name: Synchronize output
run: |
rsync \
--archive \
--verbose \
2024-03-22 19:48:33 +00:00
'out/' \
2024-03-22 19:55:15 +00:00
"cd@de.tilde.link:/cd/${GITHUB_REF_NAME}/${GITHUB_REPOSITORY}/"