Skip to content

Commit

Permalink
Support docker tag in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
j3soon committed Jul 29, 2024
1 parent 159ae30 commit 3c71830
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Ref: https://docs.docker.com/build/ci/github-actions/
name: Build Docker Images
name: Build Docker Images Upon New Git Tag

on:
push:
branches:
- "master"
- master
tags:
- v*
paths:
- .github/workflows/build.yaml
- thirdparty/**
Expand Down Expand Up @@ -33,6 +35,16 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
# Ref: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-a-registry-using-a-personal-access-token
name: Prepare tag name
run: |
# This strips the git ref prefix from the version.
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# This strips the "v" prefix from the tag name.
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# This uses the Docker `latest` tag convention.
[ "$VERSION" == "master" ] && VERSION=latest
-
name: Docker meta
id: meta
Expand All @@ -43,8 +55,7 @@ jobs:
images: ${{ secrets.DOCKERHUB_USERNAME }}/omni-farm-isaac
tags: |
type=raw,value={{date 'YYYYMMDD'}}
type=raw,value=0.1
type=raw,value=latest
type=raw,value=$VERSION
-
name: Login to Docker Hub
uses: docker/login-action@v2
Expand Down

0 comments on commit 3c71830

Please sign in to comment.