Skip to content

Commit

Permalink
Create push-docker-image.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhnajafiz authored Aug 13, 2023
1 parent 2d3ed07 commit 00b0ef3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/push-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release
on:
push:
tags:
- 'v*.*.*'

env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
REPO_NAME: ${{ secrets.REPO_NAME }}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}

jobs:
push-image-to-docker-hub: # job name
runs-on: ubuntu-latest # runner name : (ubuntu latest version)
steps:
- uses: actions/checkout@v2 # first action : checkout source code
- name: docker login
run: | # log into docker hub account
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Get current date # get the date of the build
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d--%M-%S')"
- name: Build the Docker image # push The image to the docker hub
run: docker build . --file build/Dockerfile --tag $DOCKER_USER/$REPO_NAME:$RELEASE_VERSION
- name: Docker Push
run: docker push $DOCKER_USER/$REPO_NAME:$RELEASE_VERSION

0 comments on commit 00b0ef3

Please sign in to comment.