Skip to content

Commit

Permalink
Merge pull request #8116 from 4teamwork/docker-build-self-hosted
Browse files Browse the repository at this point in the history
Use self-hosted action runner
  • Loading branch information
buchi committed Jan 28, 2025
1 parent aef8d44 commit 524a68b
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Build Docker image

on:
workflow_dispatch:
push:
tags:
- '*.*.*'
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -16,38 +19,45 @@ jobs:
run: mkdir src

- name: Checkout opengever.maintenance
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 4teamwork/opengever.maintenance
path: src/opengever.maintenance

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: tcp://buildkitd.buildx:1234

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata from Git reference
id: meta_ogcore
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
4teamwork/ogcore
flavor: |
latest=false
tags: |
type=pep440,pattern={{version}}
type=raw,value=latest,enable=${{ github.ref_type == 'tag' && github.event.base_ref == 'refs/heads/master' }}
type=edge,branch=master
- name: Build and push ogcore
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/core/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: ${{ github.ref_type == 'tag' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: true
tags: ${{ steps.meta_ogcore.outputs.tags }}
labels: ${{ steps.meta_ogcore.outputs.labels }}
Expand All @@ -58,19 +68,23 @@ jobs:
- name: Extract metadata from Git reference for ogtestserver
id: meta_ogtestserver
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
4teamwork/ogtestserver
flavor: |
latest=false
tags: |
type=pep440,pattern={{version}}
type=raw,value=latest,enable=${{ github.ref_type == 'tag' && github.event.base_ref == 'refs/heads/master' }}
type=edge,branch=master
- name: Build and push ogtestserver
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/testserver/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: ${{ github.ref_type == 'tag' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: true
tags: ${{ steps.meta_ogtestserver.outputs.tags }}
labels: ${{ steps.meta_ogtestserver.outputs.labels }}
Expand Down

0 comments on commit 524a68b

Please sign in to comment.