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 15760c5
Show file tree
Hide file tree
Showing 2 changed files with 49 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 @@
---
on:
push:
#branches:
# - "new-images"

jobs:
build-images:
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 Github container registry
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
18 changes: 18 additions & 0 deletions build-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/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} \
--tag ghcr.io/hadrienpatte/${IMAGE}-test:latest \
--build-arg VERSION=${VERSION} \
--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
#--label "org.opencontainers.image.created=${NOW}" \

0 comments on commit 15760c5

Please sign in to comment.