From b764ca1053eec3499ce40cc7c811fe5404f8e3c1 Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Thu, 19 Oct 2023 16:18:24 +0100 Subject: [PATCH] wip: prototype deploy to casparcg.com --- .github/workflows/pages.yaml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 36b8077..b475da7 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -41,10 +41,15 @@ jobs: npm run build env: CI: true - - name: Upload artifact + - name: Upload pages artifact uses: actions/upload-pages-artifact@v1 with: path: "./build" + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: docusaurus + path: "./build" # Deployment job deploy: @@ -58,3 +63,31 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v1 + + # Deployment job + deploy-ssh: + name: Deploy to + environment: + name: casparcg.com + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/download-artifact@v3 + with: + name: docusaurus + - name: Upload + shell: bash + run: | + if [ -z "$SSH_KEY" ] || [ -z "$SSH_HOST" ] || [ -z "$SSH_USERNAME" ] || [ -z "$DEPLOY_PATH" ]; then + echo "Missing deploy credentials" + else + + echo "$SSH_KEY" >> ~/.ssh/id_rsa + + rsync -avvz build/ $SSH_USERNAME@$SSH_HOST:$DEPLOY_PATH + env: + SSH_KEY : ${{secrets.DEPLOY_SSH_KEY}} + SSH_HOST : ${{secrets.DEPLOY_SSH_HOST}} + SSH_USERNAME : ${{secrets.DEPLOY_SSH_USERNAME}} + DEPLOY_PATH : ${{secrets.DEPLOY_PATH}} +