62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
name: Deploy Spot
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: spot
|
|
|
|
env:
|
|
COMPOSER_NO_INTERACTION: "1"
|
|
COMPOSER_HOME: .composer
|
|
DEPLOY_PATH: /var/www/spot
|
|
npm_config_cache: .npm-cache
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check runner tools
|
|
run: |
|
|
command -v composer
|
|
command -v npm
|
|
command -v rsync
|
|
|
|
- name: Check deploy path
|
|
run: |
|
|
test -d "$DEPLOY_PATH"
|
|
test -w "$DEPLOY_PATH"
|
|
|
|
- name: Validate Composer configuration
|
|
run: composer validate --no-check-publish
|
|
|
|
- name: Install PHP dependencies
|
|
run: composer install --no-dev --prefer-dist --optimize-autoloader
|
|
|
|
- name: Install npm dependencies
|
|
run: npm ci
|
|
|
|
- name: Prepare runtime mount points
|
|
run: mkdir -p files geo
|
|
|
|
- name: Build frontend
|
|
run: npm run prod
|
|
|
|
- name: Deploy to production
|
|
run: |
|
|
rsync -az --delete \
|
|
--exclude "/.git/" \
|
|
--exclude "/.gitea/" \
|
|
--exclude "/.composer/" \
|
|
--exclude "/.npm-cache/" \
|
|
--exclude "/node_modules/" \
|
|
--exclude "/config/settings.php" \
|
|
--exclude "/log.html" \
|
|
--exclude "/files/" \
|
|
--exclude "/geo/" \
|
|
--exclude "/gaia/" \
|
|
./ "$DEPLOY_PATH/"
|