Skip to content

Commit

Permalink
Update create-docker-hub-image.yml (#2282)
Browse files Browse the repository at this point in the history
  • Loading branch information
IOhacker authored Feb 26, 2025
1 parent 1c864ae commit 7105c20
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/create-docker-hub-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
runs-on: ubuntu-latest
env:
DOCKER_ORGANIZATION: ${{secrets.DOCKER_ORGANIZATION}}
WEB_APP_VERSION: ${{secrets.WEB_APP_LATEST_STABLE_VERSION}}

steps:
- uses: actions/checkout@v2
Expand All @@ -21,11 +20,17 @@ jobs:
run: |
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Build the Docker image
run: docker build -t web-app:latest .

- name: Docker Hub Prepare
run: docker image tag web-app $DOCKER_ORGANIZATION/web-app:$WEB_APP_VERSION
run: docker image tag web-app $DOCKER_ORGANIZATION/web-app:${{ steps.extract_branch.outputs.branch }}

- name: Docker Hub Push
run: docker image push $DOCKER_ORGANIZATION/web-app:$WEB_APP_VERSION
run: docker image push $DOCKER_ORGANIZATION/web-app:${{ steps.extract_branch.outputs.branch }}

0 comments on commit 7105c20

Please sign in to comment.