Skip to content

Commit

Permalink
Merge pull request #31 from wickywaka/pull-request
Browse files Browse the repository at this point in the history
Publish Multi-Arch images using github actions
  • Loading branch information
robinsmidsrod authored Aug 9, 2022
2 parents debb6d8 + 4d685fd commit ab18014
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/dockerize-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Push latest

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
build-push-latest:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup QEMU
id: qemu
uses: docker/[email protected]
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64

- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and Push Dockerfile.ldap
id: docker_build_ldap
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
file: Dockerfile.ldap
tags: networkboot/dhcpd:ldap-latest


- name: Print LDAP Image Digest
run: echo ${{ steps.docker_build_ldap.outputs.digest }}

- name: Build and Push Dockerfile
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: networkboot/dhcpd:latest


- name: Print Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}
66 changes: 66 additions & 0 deletions .github/workflows/dockerize-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and Push Tag
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build-push-tag:
runs-on: ubuntu-latest
steps:
- uses: olegtarasov/[email protected]
id: get-tag
with:
tagRegex: "v(.*)"

- name: Parse Semver String
id: semver-parser
uses: booxmedialtd/ws-action-parse-semver@v1
with:
input_string: "${{ steps.get-tag.outputs.tag }}"

- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup QEMU
id: qemu
uses: docker/[email protected]
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64

- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}


- name: Build and Push ldap
id: docker_build_ldap
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
file: Dockerfile.ldap
tags:
networkboot/dhcpd:ldap-${{ steps.semver-parser.outputs.fullversion }},
networkboot/dhcpd:ldap-${{ steps.semver-parser.outputs.major }}

- name: Print LDAP Image Digest
run: echo ${{ steps.docker_build_ldap.outputs.digest }}

- name: Build and Push
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags:
networkboot/dhcpd:${{ steps.semver-parser.outputs.fullversion }},
networkboot/dhcpd:${{ steps.semver-parser.outputs.major }}

- name: Print Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit ab18014

Please sign in to comment.