Skip to content

Commit

Permalink
Always create docker but not push if there is no tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jriguera committed Aug 28, 2024
1 parent 4285790 commit 06b1671
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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' }}
Expand Down

0 comments on commit 06b1671

Please sign in to comment.