2024-09-22 21:21:19 +00:00
|
|
|
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:
|
2024-09-23 10:22:53 +00:00
|
|
|
description: 'Pass in your skynet username'
|
|
|
|
required: false
|
|
|
|
default: ${{ env.GITHUB_REPOSITORY_OWNER }}
|
2024-09-22 21:21:19 +00:00
|
|
|
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:
|
2024-09-22 21:26:50 +00:00
|
|
|
- name: "Set SSH key"
|
2024-09-22 21:21:19 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
# jank I know
|
|
|
|
echo "${{ inputs.ssh_key }}" > tmp.key
|
|
|
|
chmod 600 tmp.key
|
2024-09-22 21:26:50 +00:00
|
|
|
- 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"
|
2024-09-22 21:26:50 +00:00
|
|
|
- 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 }}"
|
2024-09-22 21:26:50 +00:00
|
|
|
- name: "Copy files across"
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-09-22 21:21:19 +00:00
|
|
|
scp -v -i tmp.key -r ${{ inputs.folder }}/* ${{ inputs.username }}@skynet.skynet.ie:/home/${{ inputs.username }}/public_html/${{ inputs.destination }}
|