f523fa986c
My Gatsby Deployment pipeline / build-and-deploy (push) Successful in 3m42s
Make the portrait smaller (200px) and tighten the hero columns. Remove the "Open to new work" status and neutralise the contact copy so nothing reads as job-seeking; show a plain location in the top bar instead. Deploy/tooling: drop the unneeded `--force` from the install (verified a clean --legacy-peer-deps install + gatsby build both pass). Replace gatsby-plugin-offline with gatsby-plugin-remove-serviceworker to retire the service worker (fixes stale-cache-after-deploy and removes the workbox deprecation). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
name: My Gatsby Deployment pipeline
|
|
run-name: ${{ gitea.actor }} is deploying this page to production.
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Install dependencies
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Build Gatsby site
|
|
run: npx gatsby build
|
|
env:
|
|
NODE_ENV: production
|
|
CI: true
|
|
|
|
- name: Check build output
|
|
run: |
|
|
if [ ! -d "public" ]; then
|
|
echo "Build failed - public directory not found"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Install SSH key
|
|
uses: shimataro/ssh-key-action@v2
|
|
with:
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
|
|
|
|
- name: Install rsync
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y rsync
|
|
|
|
- name: Deploy to web server
|
|
env:
|
|
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
|
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
|
run: |
|
|
rsync -avz -e "ssh -p 2266" \
|
|
--exclude='mailadmin/' \
|
|
--exclude='postfixadmin/' \
|
|
--exclude='roundcube/' \
|
|
public/ \
|
|
$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
|
|
|
|
- name: Verify deployment
|
|
env:
|
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
|
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
|
|
run: |
|
|
ssh -p 2266 $DEPLOY_USER@$DEPLOY_HOST "test -d $DEPLOY_PATH && echo 'Deployment successful' || (echo 'Deployment failed' && exit 1)"
|