Initial commit

This commit is contained in:
Annika Backstrom 2024-04-27 09:58:57 +01:00
commit 995a69ebdc
3 changed files with 33 additions and 0 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
# Container image that runs your code
FROM git.abackstrom.com/containers/deploy
# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]

17
action.yml Normal file
View File

@ -0,0 +1,17 @@
# action.yml
name: 'Sixohthree Deploy'
description: 'Private deploy pipeline'
inputs:
local_path:
description: 'Local path'
required: false
default: './'
deploy_path:
description: 'Deploy path'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.local_path }}
- ${{ inputs.deploy_path }}

8
entrypoint.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh -l
LOCAL_PATH="$1"
REMOTE_PATH="$2"
echo rsync -hrz --delete -C --exclude=".*" -e ssh "$LOCAL_PATH" "deploy.sixohthree.com:/tmp/gitea_${GITEA_RUN_NUMBER}_${GITEA_SHA}"
echo ssh deploy.sixohthree.com "dsh -M -c -r ssh -g webs -- rsync -hvrz --delete -C -e ssh deploy.sixohthree.com:/tmp/gitea_${GITEA_RUN_NUMBER}_${GITEA_SHA}/ $REMOTE_PATH"
echo ssh deploy.sixohthree.com "rm -rf /tmp/gitea_${GITEA_RUN_NUMBER}_${GITEA_SHA}"