From f3198bfd620601efa241692d1bb0e62bb51025e0 Mon Sep 17 00:00:00 2001 From: AlexPresso Date: Thu, 11 Jan 2024 00:33:09 +0100 Subject: [PATCH] test tag --- .github/workflows/docker-image.yml | 48 ------------------------------ .github/workflows/release.yml | 38 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 287a822..0000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Push Image -on: - push: - tags: - - 'v*.*.*' - -jobs: - docker-image: - name: Create Docker Image - needs: release - runs-on: ubuntu-latest - env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - flavor: | - latest=true - prefix= - suffix= - tags: | - type=semver,pattern={{version}} - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Get the last commit tag - id: get_last_commit_tag - run: echo "::set-output name=tag::$(git describe --tags --abbrev=0)" - - - name: Build and push Docker image - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }}, ${{ steps.get_last_commit_tag.outputs.tag }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9488d3a..9d3212e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,3 +15,41 @@ jobs: uses: rymndhng/release-on-push-action@master with: bump_version_scheme: minor + + docker-image: + name: Create Docker Image + needs: release + runs-on: ubuntu-latest + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + flavor: | + latest=true + prefix= + suffix= + tags: | + type=semver,pattern={{version}} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}