actions/deploy_user/action.yml

39 lines
1.3 KiB
YAML
Raw Normal View History

name: 'Deploy to Skynet - User Edition'
description: 'Deploy to your own public_html '
inputs:
ssh_key:
description: 'Pass in secrets.SSH_KEY'
required: true
username:
description: 'Pass in your skynet username'
required: false
default: ${{ env.GITHUB_REPOSITORY_OWNER }}
folder:
description: 'Folder to upload, normally build'
required: true
destination:
description: 'location within public_html to deploy to'
required: false
default: ""
runs:
using: "composite"
steps:
- name: "Set SSH key"
shell: bash
run: |
# jank I know
echo "${{ inputs.ssh_key }}" > tmp.key
chmod 600 tmp.key
- name: "Ensure public_html exists"
shell: bash
run: |
2024-09-22 21:36:54 +00:00
ssh -v -i tmp.key ${{ inputs.username }}@skynet.skynet.ie "mkdir -p ~/public_html && chmod 711 ~ || true && chmod -R 755 ~/public_html || true"
- name: "Ensure destination exists"
shell: bash
run: |
2024-09-22 21:32:41 +00:00
ssh -v -i tmp.key ${{ inputs.username }}@skynet.skynet.ie "mkdir -p ~/public_html/${{ inputs.destination }}"
- name: "Copy files across"
shell: bash
run: |
scp -v -i tmp.key -r ${{ inputs.folder }}/* ${{ inputs.username }}@skynet.skynet.ie:/home/${{ inputs.username }}/public_html/${{ inputs.destination }}