This commit is contained in:
@@ -0,0 +1,60 @@
|
|||||||
|
name: Check and deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 10
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out the site
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
|
||||||
|
- name: Validate the site
|
||||||
|
run: npm run check
|
||||||
|
|
||||||
|
- name: Assemble the static site
|
||||||
|
run: |
|
||||||
|
install -d dist
|
||||||
|
cp index.html styles.css dist/
|
||||||
|
cp -R src vendor tiles dist/
|
||||||
|
|
||||||
|
- name: Install deployment tools
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install --yes --no-install-recommends openssh-client rsync
|
||||||
|
|
||||||
|
- name: Configure deployment SSH key
|
||||||
|
env:
|
||||||
|
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||||
|
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
|
||||||
|
run: |
|
||||||
|
install -d -m 0700 "$HOME/.ssh"
|
||||||
|
printf '%s\n' "$DEPLOY_SSH_KEY" > "$HOME/.ssh/deploy_key"
|
||||||
|
printf '%s\n' "$DEPLOY_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts"
|
||||||
|
chmod 0600 "$HOME/.ssh/deploy_key" "$HOME/.ssh/known_hosts"
|
||||||
|
|
||||||
|
- name: Upload the website
|
||||||
|
env:
|
||||||
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||||
|
run: |
|
||||||
|
rsync \
|
||||||
|
--archive \
|
||||||
|
--compress \
|
||||||
|
--delete \
|
||||||
|
--delay-updates \
|
||||||
|
--human-readable \
|
||||||
|
--itemize-changes \
|
||||||
|
--rsh "ssh -i $HOME/.ssh/deploy_key -o IdentitiesOnly=yes" \
|
||||||
|
dist/ \
|
||||||
|
"a-plot-of-plants-deploy@${DEPLOY_HOST}:/var/www/html/a-plot-of-plants/"
|
||||||
@@ -96,6 +96,23 @@ python3 -m http.server 4173
|
|||||||
|
|
||||||
Then open <http://localhost:4173>.
|
Then open <http://localhost:4173>.
|
||||||
|
|
||||||
|
## Automatic deployment
|
||||||
|
|
||||||
|
Gitea Actions validates and publishes the website after every push to `main`.
|
||||||
|
The workflow in [`.gitea/workflows/deploy.yml`](.gitea/workflows/deploy.yml)
|
||||||
|
assembles only the runtime files and syncs them to
|
||||||
|
`a-plot-of-plants-deploy@<DEPLOY_HOST>:/var/www/html/a-plot-of-plants/`.
|
||||||
|
It can also be run manually from the Actions page.
|
||||||
|
|
||||||
|
The workflow requires these repository Actions secrets:
|
||||||
|
|
||||||
|
- `DEPLOY_HOST`: the web server hostname or IP address as reached by the runner.
|
||||||
|
- `DEPLOY_SSH_KEY`: the complete private deployment key.
|
||||||
|
- `DEPLOY_KNOWN_HOSTS`: the web server's verified SSH host-key line.
|
||||||
|
|
||||||
|
The deployment deliberately excludes Git metadata, authoring documentation,
|
||||||
|
the source GeoPackage, and other development-only files.
|
||||||
|
|
||||||
## Zoom behavior
|
## Zoom behavior
|
||||||
|
|
||||||
Both the yard overlays and the local basemap are vector data, so linework stays
|
Both the yard overlays and the local basemap are vector data, so linework stays
|
||||||
|
|||||||
Reference in New Issue
Block a user