From 4b91fb9d1643db58a5690534f412e74a50ef5b89 Mon Sep 17 00:00:00 2001 From: pankalog Date: Sat, 3 Feb 2024 15:21:54 +0100 Subject: [PATCH] Used for creating release --- .github/workflows/main.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d49fd53..30bc6ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,20 +1,15 @@ -name: Docker Image CI +name: Docker Image CI - Release on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + workflow_dispatch: jobs: - build: - + CreateRelease: runs-on: ubuntu-latest steps: - - name: Check out the code uses: actions/checkout@v2 @@ -42,5 +37,21 @@ jobs: file: ./Dockerfile push: true platforms: linux/amd64,linux/arm64 - tags: ${{ secrets.DOCKER_USERNAME }}/repotest:${{ env.SHORT_SHA }} + tags: ${{ secrets.DOCKER_USERNAME }}/repotest:${{ env.SHORT_SHA }} , + ${{ secrets.DOCKER_USERNAME }}/repotest:latest + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.SHORT_SHA }} + release_name: Release ${{ env.SHORT_SHA }} + draft: false + prerelease: false + body: | + Docker images built and pushed to DockerHub: + - `${{ secrets.DOCKER_USERNAME }}/repotest:${{ env.SHORT_SHA }}` + - `${{ secrets.DOCKER_USERNAME }}/repotest:latest`