This commit is contained in:
1 parent
611ab6a9c7
commit
0d481ba33b
1 file changed
+61
@@ -0,0 +1,61 @@
|
||||
name: site
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
concurrency:
|
||||
group: site-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: build
|
||||
container:
|
||||
image: node:24-bookworm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install
|
||||
run: npm ci --ignore-scripts --no-audit --no-fund
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Validate
|
||||
run: npm run check
|
||||
|
||||
- name: Upload
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: site
|
||||
path: _site/
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
runs-on: deploy
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: site
|
||||
path: _site
|
||||
|
||||
- name: Publish
|
||||
env:
|
||||
LIVE: /deploy
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# dont sync empty builds
|
||||
test -f _site/index.html
|
||||
|
||||
rsync -trl --delete --chmod=D755,F644 _site/ "$LIVE/"
|
||||
echo "deployed site."
|
||||
Reference in new issue
Block a user