From 0cdf6bb75bc0117245f37c665d750cdb80704d97 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 21:15:40 -0400 Subject: Add workflow to Build and Push Docker Image --- .github/workflows/docker-image-release.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/docker-image-release.yml (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml new file mode 100644 index 0000000..4fe7157 --- /dev/null +++ b/.github/workflows/docker-image-release.yml @@ -0,0 +1,53 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - dev + +jobs: + build: + name: Build and Push Docker Image + runs-on: ubuntu-latest + + steps: + # Checkout the code from the repository + - name: Checkout repository + uses: actions/checkout@v3 + + # Download the latest release binary from GitHub releases + - name: Download latest release binary + run: | + latest_release=$(curl --silent "https://api.github.com/repos/donetick/donetick/releases/latest" | jq -r '.tag_name') + curl -L "https://github.com/donetick/donetick/releases/download/${latest_release}/donetick_Linux_x86_64.tar.gz" -o donetick_Linux_x86_64.tar.gz + tar -xzf donetick_Linux_x86_64.tar.gz + mv donetick_Linux_x86_64/* . + chmod +x ./donetick + + + + # Log in to Docker Hub + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + # Log in to GitHub Container Registry + - name: Login to GitHub Container Registry + uses: docker/login-action@v3.3.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + + # Build and tag Docker image + - name: Build Docker image + run: | + docker build -t ${{ secrets.DOCKER_USERNAME }}/my-go-app:${{ github.sha }} . + + # Push Docker image + - name: Push Docker image + run: | + docker push ${{ secrets.DOCKER_USERNAME }}/my-go-app:${{ github.sha }} -- cgit From 4cf427ad3e0e2ac2433100ec96ebf88d3ea5ff8e Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 21:20:22 -0400 Subject: Remove unnecessary mv command --- .github/workflows/docker-image-release.yml | 1 - 1 file changed, 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 4fe7157..6b78c77 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -21,7 +21,6 @@ jobs: latest_release=$(curl --silent "https://api.github.com/repos/donetick/donetick/releases/latest" | jq -r '.tag_name') curl -L "https://github.com/donetick/donetick/releases/download/${latest_release}/donetick_Linux_x86_64.tar.gz" -o donetick_Linux_x86_64.tar.gz tar -xzf donetick_Linux_x86_64.tar.gz - mv donetick_Linux_x86_64/* . chmod +x ./donetick -- cgit From 575742e63f79ff6a954e9031070bf997e9b4d2ef Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 21:57:14 -0400 Subject: remove docker information and use only ghrc for now --- .github/workflows/docker-image-release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 6b78c77..46c953b 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -25,12 +25,12 @@ jobs: - # Log in to Docker Hub - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + # # Log in to Docker Hub + # - name: Log in to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} # Log in to GitHub Container Registry - name: Login to GitHub Container Registry -- cgit From 65aece2cd602f38f49cdc0efc2f65a87d4d525e9 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 22:05:36 -0400 Subject: Update docker repo name --- .github/workflows/docker-image-release.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 46c953b..1067b69 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -25,28 +25,28 @@ jobs: - # # Log in to Docker Hub - # - name: Log in to Docker Hub - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} - - # Log in to GitHub Container Registry - - name: Login to GitHub Container Registry - uses: docker/login-action@v3.3.0 + # Log in to Docker Hub + - name: Log in to Docker Hub + uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + # # Log in to GitHub Container Registry + # - name: Login to GitHub Container Registry + # uses: docker/login-action@v3.3.0 + # with: + # registry: ghcr.io + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} # Build and tag Docker image - name: Build Docker image run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/my-go-app:${{ github.sha }} . + docker build -t ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} . # Push Docker image - name: Push Docker image run: | - docker push ${{ secrets.DOCKER_USERNAME }}/my-go-app:${{ github.sha }} + docker push ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} -- cgit From cce72fe05e5a598edd4dc6c1f867cc875a08f22a Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 22:42:25 -0400 Subject: Update Docker image names and build process to align with project requirements and conventions. --- .github/workflows/docker-image-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 1067b69..db68385 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -44,9 +44,10 @@ jobs: # Build and tag Docker image - name: Build Docker image run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} . + docker build -t ${{ secrets.DOCKER_USERNAME }}/my-go-app:${{ github.sha }} . # Push Docker image - name: Push Docker image run: | docker push ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} + docker push ${{ secrets.DOCKER_USERNAME }}/donetick:latest -- cgit From 9f38b6929537cb2133645698536c893391d8e3ec Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 22:42:39 -0400 Subject: Add Default tag --- .github/workflows/docker-image-release.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index db68385..0017040 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -51,3 +51,4 @@ jobs: run: | docker push ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} docker push ${{ secrets.DOCKER_USERNAME }}/donetick:latest + docker push ${{ secrets.DOCKER_USERNAME }}/donetick -- cgit From fd3e4af25b97f6ceb1fb01087f7e7b2a6765a8e6 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 22:47:59 -0400 Subject: remove donetick default --- .github/workflows/docker-image-release.yml | 1 - 1 file changed, 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 0017040..db68385 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -51,4 +51,3 @@ jobs: run: | docker push ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} docker push ${{ secrets.DOCKER_USERNAME }}/donetick:latest - docker push ${{ secrets.DOCKER_USERNAME }}/donetick -- cgit From 3868178675e0382a736e94ee6159be975ef81902 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 22:50:47 -0400 Subject: update 2 :) --- .github/workflows/docker-image-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index db68385..0e26f36 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -44,7 +44,7 @@ jobs: # Build and tag Docker image - name: Build Docker image run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/my-go-app:${{ github.sha }} . + docker build -t ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} . # Push Docker image - name: Push Docker image -- cgit From bc2b0edba29f06d74064ab6c298621dbe20303dc Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Thu, 5 Sep 2024 23:05:23 -0400 Subject: REMOVE BINARY DOWLOAD --- .github/workflows/docker-image-release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 0e26f36..715ba2e 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -15,13 +15,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - # Download the latest release binary from GitHub releases - - name: Download latest release binary - run: | - latest_release=$(curl --silent "https://api.github.com/repos/donetick/donetick/releases/latest" | jq -r '.tag_name') - curl -L "https://github.com/donetick/donetick/releases/download/${latest_release}/donetick_Linux_x86_64.tar.gz" -o donetick_Linux_x86_64.tar.gz - tar -xzf donetick_Linux_x86_64.tar.gz - chmod +x ./donetick + # # Download the latest release binary from GitHub releases + # - name: Download latest release binary + # run: | + # latest_release=$(curl --silent "https://api.github.com/repos/donetick/donetick/releases/latest" | jq -r '.tag_name') + # curl -L "https://github.com/donetick/donetick/releases/download/${latest_release}/donetick_Linux_x86_64.tar.gz" -o donetick_Linux_x86_64.tar.gz + # tar -xzf donetick_Linux_x86_64.tar.gz + # chmod +x ./donetick -- cgit From 6e5b877855c22644e777cbde9894f4ebf7c79532 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Fri, 6 Sep 2024 00:59:41 -0400 Subject: Update Docker image push command to remove specific tags and only push the latest image --- .github/workflows/docker-image-release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 715ba2e..3b3425c 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -49,5 +49,4 @@ jobs: # Push Docker image - name: Push Docker image run: | - docker push ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} - docker push ${{ secrets.DOCKER_USERNAME }}/donetick:latest + docker push ${{ secrets.DOCKER_USERNAME }}/donetick -- cgit From 5bbb4d52018a2d21de610a62902d1eee22b9237d Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Fri, 6 Sep 2024 01:06:05 -0400 Subject: Update Dockerfile and Docker image push command --- .github/workflows/docker-image-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index 3b3425c..c2959ce 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -44,9 +44,9 @@ jobs: # Build and tag Docker image - name: Build Docker image run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/donetick:${{ github.sha }} . + docker build -t ${{ secrets.DOCKER_USERNAME }}/donetick:latest . # Push Docker image - name: Push Docker image run: | - docker push ${{ secrets.DOCKER_USERNAME }}/donetick + docker push ${{ secrets.DOCKER_USERNAME }}/donetick:latest -- cgit From 48f99ea34b924bdbf3ed9187f486a3dc7de3022b Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Fri, 6 Sep 2024 01:29:09 -0400 Subject: Build docker image on push to main --- .github/workflows/docker-image-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/docker-image-release.yml b/.github/workflows/docker-image-release.yml index c2959ce..d2e34fe 100644 --- a/.github/workflows/docker-image-release.yml +++ b/.github/workflows/docker-image-release.yml @@ -3,7 +3,7 @@ name: Build and Push Docker Image on: push: branches: - - dev + - main jobs: build: -- cgit