From f7b2424bdfeefcb9a43b338e8f180b70aaf249d6 Mon Sep 17 00:00:00 2001 From: shrikar10 Date: Fri, 30 Jun 2023 09:18:40 +0530 Subject: [PATCH 1/2] Docker image version push --- .github/workflows/docker-build-push.yml | 13 ++++++++++--- version.txt | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 version.txt diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index f197a577..5239753f 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -2,13 +2,18 @@ name: Docker Build and Push on: push: branches: - - main + - main jobs: build-and-push: - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Read version from file + id: version + run: | + version=$(grep -o '^[0-9]\+\.[0-9]\+\.[0-9]\+' freegpt-webui/version.txt | head -n 1) + echo "::set-output name=version::$version" - name: Login to Docker Hub uses: docker/login-action@v1 with: @@ -20,4 +25,6 @@ jobs: context: . file: Dockerfile push: true - tags: ${{ secrets.DOCKER_USERNAME }}/freegpt-webui:latest + tags: | + ${{ secrets.DOCKER_USERNAME }}/freegpt-webui:latest + ${{ secrets.DOCKER_USERNAME }}/freegpt-webui:${{ steps.version.outputs.version }} diff --git a/version.txt b/version.txt new file mode 100644 index 00000000..50c0f705 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.0.0 - initial commit \ No newline at end of file From 51aea6ca1e1380d3fc3c0fa817f2da21df1f9280 Mon Sep 17 00:00:00 2001 From: shrikar C Kulkarni <60685603+shrikar10@users.noreply.github.com> Date: Sat, 1 Jul 2023 09:42:44 +0530 Subject: [PATCH 2/2] Update docker-build-push.yml --- .github/workflows/docker-build-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 5239753f..cc7a17bd 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -12,7 +12,7 @@ jobs: - name: Read version from file id: version run: | - version=$(grep -o '^[0-9]\+\.[0-9]\+\.[0-9]\+' freegpt-webui/version.txt | head -n 1) + version=$(grep -o '^[0-9]\+\.[0-9]\+\.[0-9]\+' version.txt | head -n 1) echo "::set-output name=version::$version" - name: Login to Docker Hub uses: docker/login-action@v1