Skip to content

Commit

Permalink
Configure github action to build images
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Mar 24, 2024
1 parent 2d3832c commit d621d90
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions build-image.sh
Original file line number Diff line number Diff line change
@@ -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 \

0 comments on commit d621d90

Please sign in to comment.