Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add Git commit sha to container labels #165

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ jobs:
- name: Checkout the source code
uses: actions/checkout@v4

- name: Build the Docker image
run: docker build -t ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest ${{ matrix.image }}/

- name: Authenticate with GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -53,6 +50,16 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

- name: Upload the Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/${{ matrix.image }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.image }}/
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}