iventoy/.github/workflows/build-image.yml
zidesm 37563a0d9f bump
fgs
2023-08-08 00:29:39 +02:00

59 lines
1.9 KiB
YAML

name: Image Build
on:
# Manueel starte
workflow_dispatch:
jobs:
init:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
iventoy: ${{ steps.iventoy.outputs.version }}
steps:
-
name: check version iventoy
id: iventoy
run: |
echo "version=$(echo iventoy-1.0.17-linux.tar.gz | cut -d '-' -f2)" >> $GITHUB_OUTPUT
-
name: print
run: |
echo ${{ steps.iventoy.outputs.version }}
docker:
name: iventoy image
runs-on: ubuntu-latest
needs:
- init
steps:
-
name: init vars
run: |
echo "iventoy: ${{ needs.init.outputs.iventoy }}"
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v3
with:
provenance: false # Breaking change introduced with 3.3.0 https://github.com/docker/build-push-action/releases/tag/v3.3.0, when an image is pushed since that version I can't retrieve the blob with labels anymore based on the digest via registry api, night have to look into an alternative way to do this
context: .
file: ./Dockerfile
labels: |
IVENTOY=${{ needs.init.outputs.iventoy }}
build-args: |
IVENTOY=${{ needs.init.outputs.iventoy }}
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ needs.init.outputs.iventoy }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest