From eda073cc5b894813e70e3f5283f2cbe40d82c433 Mon Sep 17 00:00:00 2001 From: Sylvain Gaunet <1552102+sgaunet@users.noreply.github.com> Date: Mon, 24 Jul 2023 21:27:39 +0200 Subject: [PATCH] only build/push to dockerhub on appclacks/cabourotte registry --- .github/workflows/publish.yml | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7aaf59d..1703706 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,38 +11,20 @@ jobs: - uses: actions/checkout@v2 - run: git fetch --prune --unshallow - - name: Login to GitHub Container Registry + - name: Login to Appclacks Container Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build/Push image ghcr.io/mcorbin/cabourotte:latest + username: ${{ secrets.DOCKERHUB_LOGIN }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build/Push image appclacks/cabourotte:latest shell: /usr/bin/bash {0} run: | - docker build . -t ghcr.io/mcorbin/cabourotte:latest - docker push ghcr.io/mcorbin/cabourotte:latest + docker build . -t appclacks/cabourotte:latest + docker push appclacks/cabourotte:latest # get tags of current commit tag=$(git describe --exact-match --tags $(git log -n1 --pretty='%h')) if [ ! -z "$tag" ]; then echo "Tag name from git describe: $tag" - docker tag ghcr.io/mcorbin/cabourotte:latest ghcr.io/mcorbin/cabourotte:$tag - docker push ghcr.io/mcorbin/cabourotte:$tag + docker tag appclacks/cabourotte:latest appclacks/cabourotte:$tag + docker push appclacks/cabourotte:$tag fi - - name: Login to Docker Container Registry - uses: docker/login-action@v2 - with: - username: ${{ vars.DOCKERHUB_LOGIN }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Tag and Push image to docker registry - shell: /usr/bin/bash {0} - run: | - docker tag ghcr.io/mcorbin/cabourotte:latest mcorbin/cabourotte:latest - docker push mcorbin/cabourotte:latest - # get tags of current commit - tag=$(git describe --exact-match --tags $(git log -n1 --pretty='%h')) - if [ ! -z "$tag" ]; then - echo "Tag name from git describe: $tag" - docker tag ghcr.io/mcorbin/cabourotte:latest mcorbin/cabourotte:$tag - docker push mcorbin/cabourotte:$tag - fi \ No newline at end of file