chore: fix the image tag version #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
FORCE_COLOR: 1 | |
steps: | |
- name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- uses: actions/checkout@v4 | |
with: | |
submodules: false | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN}} | |
- name: Download Earthly | |
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.7.4/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" | |
- name: Earthly version | |
run: earthly --version | |
- name: Create Version | |
id: version | |
run: | | |
# Strip git ref prefix from version | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
# Strip "v" prefix from tag name | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
# set to output var | |
echo ::set-output name=VERSION::${VERSION} | |
- name: Run Build and Push Docker Images | |
env: | |
EARTHLY_BUILD_ARGS: "COMMIT_HASH,VERSION" | |
COMMIT_HASH: ${{ github.sha }} | |
VERSION: ${{ steps.version.outputs.VERSION }} | |
run: | | |
earthly --no-cache --push +all |