Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
abmptit committed May 10, 2023
1 parent 1abb58d commit 4a44696
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,25 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Branch name
run: echo running on branch ${{ github.head_ref }} / ${{ github.ref_name }}
run: |
if [ ${{ github.head_ref }} != "" ]; then
echo running on branch ${{ github.head_ref }}
else
echo running on branch ${{ github.ref_name }}
fi
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_LOGIN }} --password-stdin
- name: build docker image
run: docker build . --file ./docker/dockerfile --tag abmptit/docker-lab-static-website:${{ github.head_ref }}${{ github.ref_name }}
run: |
if [ ${{ github.head_ref }} != "" ]; then
docker build . --file ./docker/dockerfile --tag abmptit/docker-lab-static-website:${{ github.head_ref }}
else
docker build . --file ./docker/dockerfile --tag abmptit/docker-lab-static-website:${{ github.ref_name }}
fi
- name: Push the Docker image
run: docker push abmptit/docker-lab-static-website:${{ github.head_ref }}${{ github.ref_name }}
run: |
if [ ${{ github.head_ref }} != "" ]; then
docker push abmptit/docker-lab-static-website:${{ github.head_ref }}
else
docker push abmptit/docker-lab-static-website:${{ github.ref_name }}
fi

0 comments on commit 4a44696

Please sign in to comment.