-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create build-deploy-staging-vitepress.yml
- Loading branch information
1 parent
0e7e9fb
commit c4592c7
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |