diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 485e5c7..ec21e13 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,8 @@ on: jobs: build: runs-on: ubuntu-latest + env: + dockerhub_auth: ${{ secrets.DOCKERHUB_TOKEN }} steps: - uses: actions/checkout@v3 - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* @@ -45,21 +47,21 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Login to Docker Hub - if: github.event_name != 'pull_request' + if: ${{ env.dockerhub_auth != '' }} && github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up QEMU - if: github.event_name != 'pull_request' + if: ${{ env.dockerhub_auth != '' }} && github.event_name != 'pull_request' uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - if: github.event_name != 'pull_request' + if: ${{ env.dockerhub_auth != '' }} && github.event_name != 'pull_request' uses: docker/setup-buildx-action@v2 with: platforms: linux/amd64,linux/arm64 - name: Docker image - if: github.event_name != 'pull_request' + if: ${{ env.dockerhub_auth != '' }} && github.event_name != 'pull_request' run: | mkdir plugins IMAGE=litesolutions/jenkins-objectscriptquality