Skip to content

Commit

Permalink
Rework
Browse files Browse the repository at this point in the history
  • Loading branch information
WillB97 committed Aug 25, 2024
1 parent 2dd5d4f commit 71b441e
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ on:
- ci
workflow_dispatch:

jobs:
env:
IMAGE_NAME: willb97/pyapriltags

jobs:
build-image:
runs-on: ubuntu-latest
steps:
Expand All @@ -16,13 +18,26 @@ jobs:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Build the Docker image
run: docker build . --file Dockerfile -t pyapriltags:$(git describe --tags --always)
- name: Generate release version
id: release_version
run: |
echo "WHEEL_VERSION=$IMAGE_NAME:$(git describe --tags --always)" >> "$GITHUB_OUTPUT"
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: 'Push image to GitHub Container Registry'
run: docker push ghcr.io/willb97/pyapriltags:$(git describe --tags --always)
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ghcr.io/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.release_version.outputs.WHEEL_VERSION }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 71b441e

Please sign in to comment.