/ opencodehub / .github / workflows / docker-publish.yml
swadhinbiswas feat(enterprise): add SAML 2.0, SCIM 2.0, OCI Registry, NPM package engine & Docker Hub release workflow · 7/30/2026
0257552
135 lines · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build & Push Docker Image

on:
  push:
    branches: [main]
    tags: ["v*"]
  workflow_dispatch:

env:
  REGISTRY: docker.io
  IMAGE_NAME: opencodehub/opencodehub
  ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: "true"

jobs:
  build-and-push:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Log in to DockerHub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Extract Metadata (App)
        id: meta-app
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          tags: |
            type=ref,event=branch
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=sha,prefix=
            type=raw,value=latest,enable={{is_default_branch}}
          labels: |
            org.opencontainers.image.title=OpenCodeHub Platform
            org.opencontainers.image.description=A modern, self-hosted Git platform with stacked PRs, merge queue, CI/CD, and AI review.
            org.opencontainers.image.url=https://github.com/swadhinbiswas/OpencodeHub
            org.opencontainers.image.source=https://github.com/swadhinbiswas/OpencodeHub
            org.opencontainers.image.licenses=MIT

      - name: Extract Metadata (Worker)
        id: meta-worker
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-worker
          tags: |
            type=ref,event=branch
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=sha,prefix=
            type=raw,value=latest,enable={{is_default_branch}}
          labels: |
            org.opencontainers.image.title=OpenCodeHub Worker
            org.opencontainers.image.description=Background task worker for OpenCodeHub (queues, webhooks, notifications).
            org.opencontainers.image.url=https://github.com/swadhinbiswas/OpencodeHub
            org.opencontainers.image.source=https://github.com/swadhinbiswas/OpencodeHub
            org.opencontainers.image.licenses=MIT

      - name: Extract Metadata (Runner)
        id: meta-runner
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-runner
          tags: |
            type=ref,event=branch
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=sha,prefix=
            type=raw,value=latest,enable={{is_default_branch}}
          labels: |
            org.opencontainers.image.title=OpenCodeHub Runner
            org.opencontainers.image.description=Docker-in-Docker CI/CD runner for OpenCodeHub pipelines.
            org.opencontainers.image.url=https://github.com/swadhinbiswas/OpencodeHub
            org.opencontainers.image.source=https://github.com/swadhinbiswas/OpencodeHub
            org.opencontainers.image.licenses=MIT

      - name: Build and Push App Image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./Dockerfile
          push: true
          tags: ${{ steps.meta-app.outputs.tags }}
          labels: ${{ steps.meta-app.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
          platforms: linux/amd64,linux/arm64

      - name: Build and Push Worker Image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./Dockerfile.worker
          push: true
          tags: ${{ steps.meta-worker.outputs.tags }}
          labels: ${{ steps.meta-worker.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
          platforms: linux/amd64,linux/arm64

      - name: Build and Push Runner Image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./Dockerfile.runner
          push: true
          tags: ${{ steps.meta-runner.outputs.tags }}
          labels: ${{ steps.meta-runner.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
          platforms: linux/amd64,linux/arm64

      - name: Update Docker Hub Repository Description
        uses: peter-evans/dockerhub-description@v4
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}
          repository: ${{ env.IMAGE_NAME }}
          readme-filepath: ./DOCKERHUB.md
          short-description: "Self-hosted Git platform with stacked PRs, merge queue, CI/CD, and AI code review"