Skip to content

Commit

Permalink
bump image add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tombokombo committed Jan 24, 2023
1 parent fa1ad29 commit 2cb686c
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
76 changes: 76 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: docker-build-unbound

env:
registry: ghcr.io

on:
push:
tags:
- "*"
jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Get image tags
id: tag
run: |
if [[ ${GITHUB_REF_TYPE} == tag ]]; then
tag=${GITHUB_REF##*/}
else
tag=${{ github.event.inputs.custom_tag }}
fi
echo "Tag: ${tag}"
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Checkout Server
uses: actions/checkout@v3
with:
ref: ${{ steps.tag.outputs.tag }}

- name: Create docker context
run: |
docker context create ctx
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
endpoint: ctx
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760,env.BUILDKIT_STEP_LOG_MAX_SPEED=10485760

- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
echo "Build tag ${{ steps.tag.outputs.tag }}-skywalking"
- name: Login to GHRC
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push unbound
uses: docker/build-push-action@v3
with:
context: ./images
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.registry }}/${{ github.repository }}:${{ steps.tag.outputs.tag }}, ${{ env.registry }}/${{ github.repository }}:latest
builder: ${{ steps.buildx.outputs.name }}
file: ./images/Dockerfile

- name: Build and push exporter
uses: docker/build-push-action@v3
with:
context: ./images
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.registry }}/${{ github.repository }}-exporter:${{ steps.tag.outputs.tag }}, ${{ env.registry }}/${{ github.repository }}-exporter:latest
builder: ${{ steps.buildx.outputs.name }}
file: ./images/Dockerfile-exporter
2 changes: 1 addition & 1 deletion images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:latest
FROM alpine:3.17

#RUN echo "http://dl-4.alpinelinux.org/alpine/latest-stable/main/" >> /etc/apk/repositories && \
RUN apk add --no-cache --update unbound bind-tools curl
Expand Down

0 comments on commit 2cb686c

Please sign in to comment.