Add deploy action
This commit is contained in:
parent
7e8c26ee9f
commit
34837fff2c
4 changed files with 25 additions and 0 deletions
12
.forgejo/workflows/deploy.yml
Normal file
12
.forgejo/workflows/deploy.yml
Normal 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
|
1
deploy_authorized_keys_line.txt
Normal file
1
deploy_authorized_keys_line.txt
Normal 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
9
website-deploy-action.sh
Executable 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
3
website-deploy.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
cd /home/h/pub
|
||||||
|
git pull
|
Loading…
Reference in a new issue