scope workflows
This commit is contained in:
1 parent
91343f996b
commit
ceacaa5499
3 files changed
+19
-18
No files matched your search
@@ -2,9 +2,7 @@ name: Build image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# chore/simplify-deployment is temporary, for pre-merge testing of this
|
branches: ["develop", "master"]
|
||||||
# workflow itself — remove before merge
|
|
||||||
branches: ["develop", "master", "demo", "chore/simplify-deployment"]
|
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -64,8 +62,8 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
# The hosted demo/staging instances share one host and one compose file; a
|
# The hosted staging/prod instances share one host and one compose file; each
|
||||||
# deploy recreates whichever service's image tag was just pushed.
|
# deploy pulls and recreates only its own service.
|
||||||
deploy-staging:
|
deploy-staging:
|
||||||
needs: build-and-push
|
needs: build-and-push
|
||||||
if: github.ref == 'refs/heads/develop'
|
if: github.ref == 'refs/heads/develop'
|
||||||
@@ -81,13 +79,13 @@ jobs:
|
|||||||
cd checkmate
|
cd checkmate
|
||||||
git pull
|
git pull
|
||||||
cd docs/hosting/checkmate-so
|
cd docs/hosting/checkmate-so
|
||||||
docker compose pull
|
docker compose pull checkmate-staging
|
||||||
docker compose up -d
|
docker compose up -d checkmate-staging
|
||||||
docker system prune -af
|
docker system prune -af
|
||||||
|
|
||||||
deploy-demo:
|
deploy-prod:
|
||||||
needs: build-and-push
|
needs: build-and-push
|
||||||
if: github.ref == 'refs/heads/demo'
|
if: github.ref == 'refs/heads/master'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy demo.checkmate.so
|
- name: Deploy demo.checkmate.so
|
||||||
@@ -100,6 +98,6 @@ jobs:
|
|||||||
cd checkmate
|
cd checkmate
|
||||||
git pull
|
git pull
|
||||||
cd docs/hosting/checkmate-so
|
cd docs/hosting/checkmate-so
|
||||||
docker compose pull
|
docker compose pull checkmate-demo
|
||||||
docker compose up -d
|
docker compose up -d checkmate-demo
|
||||||
docker system prune -af
|
docker system prune -af
|
||||||
@@ -12,13 +12,16 @@ image behind a TLS reverse proxy.
|
|||||||
## How deploys work
|
## How deploys work
|
||||||
|
|
||||||
`.github/workflows/build-image.yml` builds and pushes the image, then SSHes in
|
`.github/workflows/build-image.yml` builds and pushes the image, then SSHes in
|
||||||
and runs `docker compose pull && docker compose up -d` in this directory:
|
and runs `docker compose pull <service> && docker compose up -d <service>` in
|
||||||
|
this directory:
|
||||||
|
|
||||||
- push to `develop` → image tagged `:develop` → `checkmate-staging` recreated
|
- merge to `develop` → image tagged `:develop` → `checkmate-staging` recreated
|
||||||
- push to `demo` → image tagged `:demo` → `checkmate-demo` recreated
|
- merge to `master` → image tagged `:master` → `checkmate-demo` (prod) recreated
|
||||||
|
|
||||||
The host keeps a git checkout of this repo; the deploy does `git pull` first so
|
The host keeps a git checkout of this repo (on `develop`); the deploy does
|
||||||
compose/gateway changes land with the code.
|
`git pull` first so compose changes land with the code. Note the deploy only
|
||||||
|
recreates the checkmate service — changes to `gateway/nginx.conf` or the mongo
|
||||||
|
services need a manual `docker compose up -d` / gateway restart on the host.
|
||||||
|
|
||||||
## Host-local files (not committed)
|
## Host-local files (not committed)
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ services:
|
|||||||
- /etc/letsencrypt:/etc/nginx/ssl:ro
|
- /etc/letsencrypt:/etc/nginx/ssl:ro
|
||||||
- ./gateway/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./gateway/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
|
|
||||||
# Demo: demo.checkmate.so -----
|
# Prod: demo.checkmate.so -----
|
||||||
checkmate-demo:
|
checkmate-demo:
|
||||||
image: ghcr.io/bluewave-labs/checkmate:demo
|
image: ghcr.io/bluewave-labs/checkmate:master
|
||||||
container_name: checkmate-demo
|
container_name: checkmate-demo
|
||||||
restart: always
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
|
|||||||
Reference in new issue
Block a user