feat: add CI/CD workflow and switch to bind mount for data
All checks were successful
Deploy c4 / deploy (push) Successful in 1m19s
All checks were successful
Deploy c4 / deploy (push) Successful in 1m19s
Use a Gitea Actions workflow to deploy on push to main via act_runner on the games VM. Switch from a Docker named volume to a ./data bind mount for easier backup and persistence across deploys.
This commit is contained in:
22
.gitea/workflows/deploy.yml
Normal file
22
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: Deploy c4
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
env:
|
||||||
|
DEPLOY_DIR: /home/ryan/c4
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Sync to deploy directory
|
||||||
|
run: |
|
||||||
|
mkdir -p $DEPLOY_DIR
|
||||||
|
rsync -a --delete --exclude 'data/' . $DEPLOY_DIR/
|
||||||
|
|
||||||
|
- name: Rebuild and restart
|
||||||
|
run: cd $DEPLOY_DIR && docker compose up -d --build --remove-orphans
|
||||||
@@ -11,7 +11,4 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- PORT=8080
|
- PORT=8080
|
||||||
volumes:
|
volumes:
|
||||||
- c4-data:/app/data
|
- ./data:/app/data
|
||||||
|
|
||||||
volumes:
|
|
||||||
c4-data:
|
|
||||||
|
|||||||
Reference in New Issue
Block a user