dot-emacs/.gitea/workflows/publish.yaml

48 lines
1.2 KiB
YAML
Raw Normal View History

2023-04-01 21:34:25 +02:00
name: Publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
2023-04-02 12:33:40 +02:00
container: silex/emacs:28.1-alpine-ci
2023-04-01 21:34:25 +02:00
steps:
- name: Install packages
2023-04-02 12:35:02 +02:00
run: apk add --no-cache openssh nodejs
2023-04-01 21:34:25 +02:00
- name: Add SSH key
run: |
mkdir ~/.ssh
chmod 700 ~/.ssh
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
echo "$SSH_KNOWN_HOSTS" | tr -d '\r' >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
- name: Check out
uses: actions/checkout@v3
- name: Build publish script
run: emacs -Q --script publish/publish.el
- name: Deploy build
run: |
rsync \
--archive \
--verbose \
--chown=gitlab-ci:www-data\
--delete\
--progress\
-e"ssh -p "$SSH_PORT""\
public/\
"$SSH_USER"@mmk2410.org:/var/www/config.mmk2410.org/
env:
SSH_USER: ${{secrets.SSH_USER}}
SSH_PORT: ${{secrets.SSH_PORT}}