diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml new file mode 100644 index 0000000..c831982 --- /dev/null +++ b/.github/workflows/build-images.yaml @@ -0,0 +1,32 @@ +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: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_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..83e7a21 --- /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 \ + --platform linux/amd64,linux/arm64 \ + --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