From da9ca08fa2e9bb8823749994310c02b990eb8ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Sat, 1 May 2021 20:25:19 +0200 Subject: [PATCH] Update release GitHub action to deploy to DockerHub The release pipeline now should build and push the c2g image to DockerHub when building a tag, tagging the image with the tag's version number as well as with "latest". --- .github/workflows/release_tag.yml | 18 ++++++++++++++++++ Cargo.lock | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml index 5742b62..5c19e15 100644 --- a/.github/workflows/release_tag.yml +++ b/.github/workflows/release_tag.yml @@ -54,3 +54,21 @@ jobs: files: 'c2g*' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get tag + uses: olegtarasov/get-tag@v2.1 + with: + tagRegex: "v(.*)" + tagRegexGroup: 1 + + - name: Docker build and push + uses: docker/build-push-action@v2 + with: + push: true + tags: tomasfarias/c2g:${{ GIT_TAG_NAME }},tomasfarias/c2g:latest diff --git a/Cargo.lock b/Cargo.lock index 373e879..70c2ae0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -100,7 +100,7 @@ checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "c2g" -version = "0.5.0" +version = "0.5.1" dependencies = [ "clap", "env_logger",