update workflows
This commit is contained in:
1 parent
dffce2709e
commit
40a7599388
5 files changed
+42
-475
No files matched your search
@@ -2,7 +2,7 @@ name: Build image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["develop", "master"]
|
branches: ["develop", "master", "demo"]
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -41,10 +41,10 @@ jobs:
|
|||||||
flavor: |
|
flavor: |
|
||||||
latest=false
|
latest=false
|
||||||
tags: |
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||||
type=raw,value=edge,enable=${{ startsWith(github.ref, 'refs/heads/') }}
|
|
||||||
|
|
||||||
- name: Build and push multi-arch image
|
- name: Build and push multi-arch image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -57,3 +57,43 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
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
|
||||||
|
# deploy recreates whichever service's image tag was just pushed.
|
||||||
|
deploy-staging:
|
||||||
|
needs: build-and-push
|
||||||
|
if: github.ref == 'refs/heads/develop'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Deploy staging.checkmate.so
|
||||||
|
uses: appleboy/ssh-action@v1.2.2
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.DEMO_SERVER_HOST }}
|
||||||
|
username: ${{ secrets.DEMO_SERVER_USER }}
|
||||||
|
key: ${{ secrets.DEMO_SERVER_SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
cd checkmate
|
||||||
|
git pull
|
||||||
|
cd docs/hosting/checkmate-so
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
|
docker system prune -af
|
||||||
|
|
||||||
|
deploy-demo:
|
||||||
|
needs: build-and-push
|
||||||
|
if: github.ref == 'refs/heads/demo'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Deploy demo.checkmate.so
|
||||||
|
uses: appleboy/ssh-action@v1.2.2
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.DEMO_SERVER_HOST }}
|
||||||
|
username: ${{ secrets.DEMO_SERVER_USER }}
|
||||||
|
key: ${{ secrets.DEMO_SERVER_SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
cd checkmate
|
||||||
|
git pull
|
||||||
|
cd docs/hosting/checkmate-so
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
|
docker system prune -af
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
name: Deploy images on release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
docker-build-and-push-client:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Extract version from tag
|
|
||||||
id: extract_tag
|
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Client Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-client:${{ steps.extract_tag.outputs.version }} \
|
|
||||||
-f ./docker/dist/client.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Client Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-client:${{ steps.extract_tag.outputs.version }}
|
|
||||||
|
|
||||||
docker-build-and-push-server:
|
|
||||||
needs: docker-build-and-push-client
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Extract version
|
|
||||||
id: extract_tag
|
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Server Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-backend:${{ steps.extract_tag.outputs.version }} \
|
|
||||||
-f ./docker/dist/server.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Server Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-backend:${{ steps.extract_tag.outputs.version }}
|
|
||||||
|
|
||||||
- name: Build Mongo Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-mongo:${{ steps.extract_tag.outputs.version }} \
|
|
||||||
-f ./docker/dist/mongoDB.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push MongoDB Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-mongo:${{ steps.extract_tag.outputs.version }}
|
|
||||||
|
|
||||||
docker-build-and-push-server-mono-multiarch:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Extract version
|
|
||||||
id: extract_tag
|
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push multi-arch Docker image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./docker/dist-arm/server.Dockerfile
|
|
||||||
push: true
|
|
||||||
no-cache: true
|
|
||||||
tags: |
|
|
||||||
ghcr.io/bluewave-labs/checkmate-backend-mono-multiarch:${{ steps.extract_tag.outputs.version }}
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate
|
|
||||||
build-args: |
|
|
||||||
VITE_APP_VERSION=${{ steps.extract_tag.outputs.version }}
|
|
||||||
|
|
||||||
docker-build-and-push-server-mono:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Extract version
|
|
||||||
id: extract_tag
|
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Server Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-backend-mono:${{ steps.extract_tag.outputs.version }} \
|
|
||||||
-f ./docker/dist-mono/server.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
--build-arg VITE_APP_VERSION=${{ steps.extract_tag.outputs.version }} \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Server Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate-backend-mono:${{ steps.extract_tag.outputs.version }}
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
name: Deploy images
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["master"]
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
docker-build-and-push-client:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: vars
|
|
||||||
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
||||||
- name: Build Client Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-client:latest \
|
|
||||||
-f ./docker/dist/client.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
--build-arg VITE_APP_VERSION=${{ env.VERSION }} \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Client Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-client:latest
|
|
||||||
|
|
||||||
docker-build-and-push-server:
|
|
||||||
needs: docker-build-and-push-client
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Server Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-backend:latest \
|
|
||||||
-f ./docker/dist/server.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Server Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-backend:latest
|
|
||||||
|
|
||||||
- name: Build Mongo Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-mongo:latest \
|
|
||||||
-f ./docker/dist/mongoDB.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push MongoDB Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-mongo:latest
|
|
||||||
|
|
||||||
docker-build-and-push-server-mono-multiarch:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: vars
|
|
||||||
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push multi-arch Docker image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./docker/dist-arm/server.Dockerfile
|
|
||||||
push: true
|
|
||||||
no-cache: true
|
|
||||||
tags: |
|
|
||||||
ghcr.io/bluewave-labs/checkmate-backend-mono-multiarch:latest
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate
|
|
||||||
build-args: |
|
|
||||||
VITE_APP_VERSION=${{ env.VERSION }}
|
|
||||||
|
|
||||||
docker-build-and-push-server-mono:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: vars
|
|
||||||
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build Server Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-backend-mono:latest \
|
|
||||||
-f ./docker/dist-mono/server.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
--build-arg VITE_APP_VERSION=${{ env.VERSION }} \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Server Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate-backend-mono:latest
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
name: Demo deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "demo" ]
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
docker-build-and-push-client:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: vars
|
|
||||||
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
||||||
- name: Build Client Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:frontend-demo \
|
|
||||||
-f ./docker/prod/client.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
--build-arg VITE_APP_VERSION=${{ env.VERSION }} \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Client Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:frontend-demo
|
|
||||||
|
|
||||||
docker-build-and-push-server:
|
|
||||||
needs: docker-build-and-push-client
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Server Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:backend-demo \
|
|
||||||
-f ./docker/prod/server.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Server Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:backend-demo
|
|
||||||
|
|
||||||
- name: Build Mongo Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:mongo-demo \
|
|
||||||
-f ./docker/prod/mongoDB.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push MongoDB Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:mongo-demo
|
|
||||||
|
|
||||||
deploy-to-demo:
|
|
||||||
needs: docker-build-and-push-server
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: SSH into server and restart container using Docker Compose
|
|
||||||
uses: appleboy/ssh-action@v1.2.2
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEMO_SERVER_HOST }}
|
|
||||||
username: ${{ secrets.DEMO_SERVER_USER }}
|
|
||||||
key: ${{ secrets.DEMO_SERVER_SSH_KEY }}
|
|
||||||
script: |
|
|
||||||
cd checkmate
|
|
||||||
git pull
|
|
||||||
cd docker/unified
|
|
||||||
docker compose down
|
|
||||||
docker compose pull
|
|
||||||
docker compose up -d
|
|
||||||
docker system prune -af
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
name: Staging deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "develop" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-build-and-push-client:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: vars
|
|
||||||
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
||||||
- name: Build Client Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:frontend-staging \
|
|
||||||
-f ./docker/staging/client.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
--build-arg VITE_APP_VERSION=${{ env.VERSION }} \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Client Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:frontend-staging
|
|
||||||
|
|
||||||
docker-build-and-push-server:
|
|
||||||
needs: docker-build-and-push-client
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build Server Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:backend-staging \
|
|
||||||
-f ./docker/staging/server.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Server Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:backend-staging
|
|
||||||
|
|
||||||
- name: Build Mongo Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:mongo-staging \
|
|
||||||
-f ./docker/staging/mongoDB.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push MongoDB Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:mongo-staging
|
|
||||||
|
|
||||||
deploy-to-staging:
|
|
||||||
needs: docker-build-and-push-server
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: SSH into server and restart container using Docker Compose
|
|
||||||
uses: appleboy/ssh-action@v1.2.2
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.DEMO_SERVER_HOST }}
|
|
||||||
username: ${{ secrets.DEMO_SERVER_USER }}
|
|
||||||
key: ${{ secrets.DEMO_SERVER_SSH_KEY }}
|
|
||||||
script: |
|
|
||||||
cd checkmate
|
|
||||||
git pull
|
|
||||||
cd docker/unified
|
|
||||||
docker compose down
|
|
||||||
docker compose pull
|
|
||||||
docker compose up -d
|
|
||||||
docker system prune -af
|
|
||||||
Reference in new issue
Block a user