Skip to content

Push Docker Images to Registry #8

Push Docker Images to Registry

Push Docker Images to Registry #8

Workflow file for this run

name: Push Docker Images to Registry
on:
release:
types: [published]
workflow_dispatch:
jobs:
push-admin:
runs-on: ubuntu-latest
name: Push Admin Docker Image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from package.json
id: package_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION"
- 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.PAT_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/devscalelabs/opencircle-admin
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=${{ steps.package_version.outputs.version }}
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.source=https://github.com/devscalelabs/opencircle
org.opencontainers.image.description=OpenCircle Admin Application
org.opencontainers.image.licenses=AGPL-3.0
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/admin/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
push-api:
runs-on: ubuntu-latest
name: Push API Docker Image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from package.json
id: package_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION"
- 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.PAT_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/devscalelabs/opencircle-api
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=${{ steps.package_version.outputs.version }}
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.source=https://github.com/devscalelabs/opencircle
org.opencontainers.image.description=OpenCircle API Backend
org.opencontainers.image.licenses=AGPL-3.0
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/api/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
push-platform:
runs-on: ubuntu-latest
name: Push Platform Docker Image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from package.json
id: package_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION"
- 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.PAT_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/devscalelabs/opencircle-platform
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=${{ steps.package_version.outputs.version }}
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.source=https://github.com/devscalelabs/opencircle
org.opencontainers.image.description=OpenCircle Platform Application
org.opencontainers.image.licenses=AGPL-3.0
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/platform/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64