diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 8a065b4..f2ef026 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -13,7 +13,22 @@ jobs: runs-on: ubuntu-latest steps: - run: echo success + + login: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: whalebrewci + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} docker-build: + needs: + - login runs-on: ubuntu-latest strategy: fail-fast: false @@ -120,16 +135,14 @@ jobs: fi if: steps.is-modified.outputs.modified == 'true' || (github.event_name == 'push' && github.event.ref == 'refs/heads/re-builld-all') - run: | - echo ${{ secrets.DOCKER_HUB_PASSWORD }} | base64 -d | docker login --password-stdin -u whalebrewci - echo ${{ github.token }} | docker login --password-stdin -u ${{ github.actor }} docker.pkg.github.com docker tag ${{ matrix.image }} ${{ github.event.repository.owner.name}}/${{ matrix.image }} - docker tag ${{ matrix.image }} docker.pkg.github.com/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }} + docker tag ${{ matrix.image }} ghcr.io/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }} if [ -e "${{ matrix.image }}/tags.yaml" ]; then for tag in $(cat "${{ matrix.image }}/tags.yaml" | docker run --rm -i whalebrew/yq -r '.versions[]'); do docker tag ${{ matrix.image }}:${tag} ${{ github.event.repository.owner.name}}/${{ matrix.image }}:${tag} - docker tag ${{ matrix.image }}:${tag} docker.pkg.github.com/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag} + docker tag ${{ matrix.image }}:${tag} ghcr.io/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag} docker push ${{ github.event.repository.owner.name}}/${{ matrix.image }}:${tag} - docker push docker.pkg.github.com/${{ github.event.repository.owner.name}}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag} + docker push ghcr.io/${{ github.event.repository.owner.name}}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag} done fi