Skip to content

Commit

Permalink
Create build-deploy-staging-vitepress.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-tonsen authored Oct 27, 2023
1 parent 0e7e9fb commit c4592c7
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build-deploy-staging-vitepress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build/Deploy to Staging (Vitepress)

on:
workflow_dispatch: # this makes the action manual

jobs:
build:
name: Install dependencies and generate static site
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Neon dependencies
working-directory: ./neon
run: npm install
- name: Neon build
working-directory: ./neon
run: npm run docs:build

- name: Neon write commit SHA to gitcommit.txt in dist
shell: bash
run: |
echo $GITHUB_SHA > neon/.vitepress/dist/gitcommit.txt
- name: Neon get size of files in dist
shell: bash
run: |
du -ah neon/.vitepress/dist
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: neon-vitepress-dist
path: neon/.vitepress/dist

deploy-staging:
name: Deploy to staging
runs-on: ubuntu-latest
environment:
name: staging
url: https://docs-staging.pupil-labs.com
needs: build

steps:
- uses: actions/checkout@v3

- name: Download generated website dist dir
uses: actions/download-artifact@v2
with:
name: neon-vitepress-dist
path: neon/.vitepress/dist

- name: Rsync action - Deploy to staging
uses: burnett01/[email protected]
with:
switches: -hrvz --delete --exclude=".htaccess"
path: neon/.vitepress/dist/
remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.REMOTE_HOST}}
remote_user: ${{ secrets.REMOTE_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}

0 comments on commit c4592c7

Please sign in to comment.