Skip to content

Commit

Permalink
change pushing to docker image repo
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun authored Nov 23, 2024
1 parent 2879fbb commit 563c2e0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ jobs:

- name: build and push master image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
USERNAME: ${{ github.actor }}
run: |
docker build -t radiot/tg-retrans:master .
docker login --username ${{ secrets.DOCKERHUB_USER }} --password ${{ secrets.DOCKERHUB_PASSWD }}
echo ${DOCKER_HUB_TOKEN} | docker login -u ${USERNAME} --password-stdin
docker push radiot/tg-retrans:master
- name: build and push tagged image
if: github.event_name == 'push' && github.event.ref_type == 'tag'
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
USERNAME: ${{ github.actor }}
run: |
GIT_TAG="${GITHUB_REF#refs/tags/}"
docker build -t radiot/tg-retrans:${GIT_TAG} .
docker login --username ${{ secrets.DOCKERHUB_USER }} --password ${{ secrets.DOCKERHUB_PASSWD }}
echo ${DOCKER_HUB_TOKEN} | docker login -u ${USERNAME} --password-stdin
docker push radiot/tg-retrans:${GIT_TAG}
docker tag radiot/tg-retrans:${GIT_TAG} radiot/tg-retrans:latest
docker push radiot/tg-retrans:latest

0 comments on commit 563c2e0

Please sign in to comment.