Add deploy action

This commit is contained in:
9pfs 2024-04-06 17:56:50 -07:00
parent 7e8c26ee9f
commit 34837fff2c
Signed by: 9pfs
SSH key fingerprint: SHA256:TOcGxMQCfy4VvRM8AzgXErKXdkAtaTcpGXgYMpyoJoY
4 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,12 @@
name: 'Deploy website to nest'
author: '9pfs@amcforum.wiki (h @ nest)'
jobs:
deploy:
runs-on: docker
container:
image: code.forgejo.org/oci/alpine:3.19
steps:
- uses: actions/checkout@v3
- id: deploy
run: |
bash website-deploy-action.sh

View file

@ -0,0 +1 @@
command="/home/h/website-deploy.sh --useless-parameter-here-to-be-safe",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,restrict ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoPP7PHUk6Qc/SC+4nB4cdEc9OHN3gTwXLVQ38LJftf h-forgejo-actions-auto-deploy-h.hackclub.app@nest

9
website-deploy-action.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
# Assuming that this is an Alpine container.
apk update
apk upgrade
apk add openssh
mkdir .ssh
echo $DEPLOY_SSH_KEY > .ssh/id_ed25519
chmod -R go-rwx .ssh
exec ssh h@hackclub.app

3
website-deploy.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
cd /home/h/pub
git pull