Skip to content

wip: prototype deploy to casparcg.com #11

wip: prototype deploy to casparcg.com

wip: prototype deploy to casparcg.com #11

Workflow file for this run

name: Node CI
on:
push:
branches:
- "docusaurus"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
deployments: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
name: Build pages
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "npm"
- name: Prepare Environment
run: |
npm ci
env:
CI: true
- name: Run docusaurus
run: |
npm run build
env:
CI: true
- 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:
name: Deploy pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- 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}}