typo #14
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: 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 casparcg.com | |
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 | |
# install ssh key | |
mkdir ~/.ssh | |
echo "$SSH_KEY" >> ~/.ssh/id_rsa | |
chmod -R 600 ~/.ssh | |
# perform copy | |
rsync -avvz build/ $SSH_USERNAME@$SSH_HOST:$DEPLOY_PATH | |
fi | |
env: | |
SSH_KEY : ${{secrets.DEPLOY_SSH_KEY}} | |
SSH_HOST : ${{secrets.DEPLOY_SSH_HOST}} | |
SSH_USERNAME : ${{secrets.DEPLOY_SSH_USERNAME}} | |
DEPLOY_PATH : ${{secrets.DEPLOY_PATH}} | |