Skip to content

Commit

Permalink
Fix docker repository requiring name to be lowercase.
Browse files Browse the repository at this point in the history
* use docker/metadata-action@v5 to define docker tags
  • Loading branch information
evgri243 committed Nov 6, 2023
1 parent 2c155d1 commit 5366afb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
Expand Down Expand Up @@ -45,15 +47,26 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Define Docker tags
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/simulator
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=match,pattern=v(.*),group=1
type=ref,event=pr,prefix=pr-
type=sha,prefix=sha-,format=short
type=sha,prefix=sha-,format=long
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
platforms: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
tags: ghcr.io/${{ github.repository }}/runner:latest,ghcr.io/${{ github.repository }}/runner:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/runner:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}



Expand Down

0 comments on commit 5366afb

Please sign in to comment.