Skip to content

video in readme

video in readme #9

name: Docker Build + Publish + Deploy
on:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-server:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from package.json
id: version
run: echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true
build-and-push-worker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from package.json
id: version
run: echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-worker
tags: |
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.worker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true
# deploy:
# name: Deploy
# runs-on: ubuntu-latest
#
# needs:
# - build-and-push-server
# - build-and-push-worker
#
# steps:
# - name: Checkout
# id: checkout
# uses: actions/checkout@v4
#
# - name: Deploy Agent Swarm
# uses: tarasyarema/dokploy-deploy-action@main
# with:
# application_id: h4or-knfw2HWkTzjLmrn8
# application_name: agent-swarm-nrz8v0
# dokploy_url: https://app.dokploy.com
# auth_token: ${{ secrets.DOKPLOY_TOKEN }}
# wait_for_completion: true
# restart: true