From d621d90a425a8bb321ea83d6a8a9c35b34baa16e Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Mon, 25 Mar 2024 00:00:36 +0100 Subject: [PATCH] Configure github action to build images --- .github/workflows/build-images.yaml | 31 +++++++++++++++++++++++++++++ build-image.sh | 17 ++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/build-images.yaml create mode 100755 build-image.sh diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml new file mode 100644 index 0000000..a8118b2 --- /dev/null +++ b/.github/workflows/build-images.yaml @@ -0,0 +1,31 @@ +name: ci + +on: + push: + #branches: + # - "new-images" + +jobs: + docker: + runs-on: ubuntu-latest + 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: Login to Docker Hub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + #- name: Build and push + # uses: docker/build-push-action@v5 + # with: + # context: . + # platforms: linux/amd64,linux/arm64 + # push: true + # tags: user/app:latest + - name: Run build script + run: ./build-image.sh radarr diff --git a/build-image.sh b/build-image.sh new file mode 100755 index 0000000..f5541f9 --- /dev/null +++ b/build-image.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +IMAGE=$1 +VERSION=$(./images/${IMAGE}/version.sh) +NOW=$(date --rfc-3339=seconds) + +docker buildx build \ + --push \ + --tag ghcr.io/hadrienpatte/${IMAGE}-test:${VERSION} \ + --build-arg VERSION=${VERSION} \ + --label "org.opencontainers.image.created=${NOW}" \ + --label "org.opencontainers.image.authors=HadrienPatte" \ + --label "org.opencontainers.image.source=https://github.com/HadrienPatte/images" \ + --label "org.opencontainers.image.version=${VERSION}" \ + --label "org.opencontainers.image.vendor=HadrienPatte" \ + --label "org.opencontainers.image.title=${IMAGE}" \ + - < images/${IMAGE}/Dockerfile + #--platform linux/amd64,linux/arm64 \