test
Some checks failed
/ debug (push) Failing after 36s

This commit is contained in:
lubiana 2024-12-12 20:20:48 +01:00
commit e5584dd778
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
957 changed files with 11340 additions and 0 deletions

12
actions/hugo/Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM alpine:latest
RUN apk add --no-cache \
brotli \
gzip \
hugo
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

7
actions/hugo/README.md Normal file
View file

@ -0,0 +1,7 @@
# Forgejo-Action for building hugo pages
This Action builds a hugo site and runs both gzip and brotli on static text files so a properly configured webbrowser can serve those precompressed files
The compression only works on files in the "public" folder of the actions workdir.

5
actions/hugo/action.yml Normal file
View file

@ -0,0 +1,5 @@
name: 'hugo'
despriction: 'oguh'
runs:
using: 'docker'
image: 'Dockerfile'

View file

@ -0,0 +1,6 @@
#!/bin/sh -l
sh -c "hugo"
sh -c "find ./public -type f -regex '.*\.\(css\|html\|js\|json\|svg\|xml\)$' -exec brotli --best -f {} \+ -exec gzip --best -k -f {} \+"
exit 0

10
actions/rsync/Dockerfile Normal file
View file

@ -0,0 +1,10 @@
FROM alpine:latest
RUN apk add --no-cache \
openssh \
rsync
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

37
actions/rsync/README.md Normal file
View file

@ -0,0 +1,37 @@
# Simple rsync Action
this actions uses rsync to syncronize a folder via ssh to another server
## Parameters:
- `rsync_parameters`* - For the required rsync parameters, example: `-avz --delete`
- `path` - local path, if not specified the current workdir is used
- `remote_path`* - the path on the remote server
- `remote_user`* - the username to be used for ssh
- `remote_host`* - the server to deploy to
- `remote_key`* - the ssh key to use for authentication
## Example Usage:
```yml
name: DEPLOY
on:
push:
branches:
- master
jobs:
deploy:
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: rsync
uses: https://git.hannover.ccc.de/c3h/actions-rsync-deployment@v1
with:
rsync_parameters: -avz --delete
path: public/
remote_path: /home/web/public
remote_host: example.com
remote_user: i_use_arch_btw
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
```

29
actions/rsync/action.yml Normal file
View file

@ -0,0 +1,29 @@
name: 'Rsync Deployment Action'
despriction: 'Forgejo Action for deploying code with rsync over ssh'
inputs:
rsync_parameters:
description: 'parameters to be passed to the rsync command'
required: true
path:
description: 'the local path'
required: false
default: ''
remote_path:
description: 'the remote path'
required: true
remote_host:
description: 'the remote host'
required: true
remote_port:
description: 'the remote port'
required: false
default: 22
remote_user:
description: 'The remote user'
required: true
remote_key:
description: 'The remote key'
required: true
runs:
using: 'docker'
image: 'Dockerfile'

View file

@ -0,0 +1,17 @@
#!/bin/sh -l
mkdir -p ~/.ssh/
# Print the SSH key, replacing newline characters with actual new lines
echo "$INPUT_REMOTE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
# Set appropriate permissions for the SSH key
chmod 600 ~/.ssh/id_rsa
# Add the remote host's key to the known_hosts file to avoid authenticity confirmation
ssh-keyscan -H ${INPUT_REMOTE_HOST} >> ~/.ssh/known_hosts
# SCP files to the remote host
sh -c "rsync ${INPUT_RSYNC_PARAMETERS} ${INPUT_PATH} ${INPUT_REMOTE_USER}@${INPUT_REMOTE_HOST}:${INPUT_REMOTE_PATH}"
exit 0