Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
chore: build with correct ref
Browse files Browse the repository at this point in the history
Signed-off-by: Gustavo <[email protected]>
  • Loading branch information
gusinacio committed Jul 3, 2024
1 parent 2fdc5fb commit 1d65466
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: docker
on:
on:
push:
branches:
- main
tags:
- '*'
- "*"

env:
REGISTRY: ghcr.io/${{ github.repository_owner }}
Expand All @@ -21,15 +21,26 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get tag
id: get-tag
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/elric-rs
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}
type=sha
- name: Build and push
uses: docker/build-push-action@v4
with:
build-args: |
TARGET=${{ matrix.contract }}
push: true
tags: |
${{ env.REGISTRY }}/elric-rs:latest
${{ env.REGISTRY }}/elric-rs:${{ steps.get-tag.outputs.short_ref }}
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 1d65466

Please sign in to comment.