Skip to content

Commit

Permalink
Merge pull request #206 from movio/update-image-action
Browse files Browse the repository at this point in the history
Update image action to add labels
  • Loading branch information
pkqk authored May 3, 2023
2 parents 9be616a + 96fe6da commit a2b73b4
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,40 @@ on:
tags:
- 'v*.*.*'
jobs:
push_to_registry:
push-to-ghcr:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set BRAMBLE_VERSION env
run: echo "BRAMBLE_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/movio/bramble

- name: Login to GH Container Registry
uses: docker/login-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_ACCESS_TOKEN }}

- name: Push to GH Container Registry
uses: docker/build-push-action@v2
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/movio/bramble

- name: Push to ghcr.io
uses: docker/build-push-action@v4
with:
context: .
registry: ghcr.io
push: true
build-args: |
VERSION=${{ env.BRAMBLE_VERSION }}
tags: ${{ steps.docker_meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit a2b73b4

Please sign in to comment.