diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 8efdc4e..5fbaba1 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -69,7 +69,6 @@ jobs: packages: write needs: - compile - if: ${{ (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags/')) }} runs-on: ubuntu-latest steps: - name: Checkout @@ -96,13 +95,6 @@ jobs: type=ref,event=branch type=sha - - name: Log in to the GitHub Container registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and export to Docker uses: docker/build-push-action@v6 with: @@ -116,8 +108,17 @@ jobs: # run: | # docker run --rm otelcol + - name: Log in to the GitHub Container registry + if: ${{ (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags/')) }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push to Github Packages uses: docker/build-push-action@v6 + if: ${{ (github.event_name != 'pull_request') && (startsWith(github.ref, 'refs/tags/')) }} with: context: ${{ env.DOCKER_BUILD_DIR }} push: ${{ github.event_name != 'pull_request' }}