githubui.xogames.org #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: githubui.xogames.org | |
env: | |
PROJECT: githubui | |
HOST: xogames.org | |
SITES_ENABLED: '~/sites-enabled/' | |
PUBLIC_HTML: '~/githubui.xogames.org/' | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup SSH key | |
run: | | |
echo "${{ secrets.DEPLOYMENT_USER_KEY }}" > deploy_key.pem | |
chmod 600 deploy_key.pem | |
- name: Create target directories if they don't exist | |
run: | | |
ssh -i deploy_key.pem -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ env.HOST }} "mkdir -p ${{ env.PUBLIC_HTML }}" | |
- name: Copy build files via SSH | |
run: | | |
scp -i deploy_key.pem -r build/* ${{ secrets.USERNAME }}@${{ env.HOST }}:${{ env.PUBLIC_HTML }} | |
scp -i deploy_key.pem githubui.caddy ${{ secrets.USERNAME }}@${{ env.HOST }}:${{ env.SITES_ENABLED }} |