Skip to content

Commit

Permalink
Docker hub build/push (#107)
Browse files Browse the repository at this point in the history
* Create docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* Update docker-image.yml
  • Loading branch information
OnlyFart authored Sep 2, 2024
1 parent fbcecf4 commit a264a5f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Docker Image to Docker Hub

on: push
jobs:
push_to_registry:
name: push docker image to hub
runs-on: ubuntu-latest
steps:
- name: check repository
uses: actions/checkout@v4

- name: login to docker registry
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}

- uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: Elib2Ebook/Elib2Ebook.csproj

- name: "get-last-release"
id: last_release
uses: InsonusK/[email protected]
with:
myToken: ${{ github.token }}

- name: build and push docker image to registry
if: ${{ steps.last_release.outputs.tag_name != steps.get-version.outputs.version }}
uses: docker/build-push-action@v5
with:
context: "Elib2Ebook"
push: true
tags: onlyfart/elib2ebook:${{steps.get-version.outputs.version}}

- name: build and push docker image to registry
if: ${{ steps.last_release.outputs.tag_name != steps.get-version.outputs.version }}
uses: docker/build-push-action@v5
with:
context: "Elib2Ebook"
push: true
tags: onlyfart/elib2ebook:latest

0 comments on commit a264a5f

Please sign in to comment.