From de6103cffce53ea8871addb5705b4d529ab2028f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Haugsb=C3=B8?= Date: Sat, 14 Sep 2024 14:16:47 +0200 Subject: [PATCH] :wrench: Only push to dockerHub when on main branch --- .github/workflows/deploy.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b9f65f5..0681daa 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,14 +1,9 @@ -# This workflow will build a .NET project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net - -name: Frontend Build and Push to DockerHub +name: Build & push Docker image (if main branch) on: push: - # branches: ["main"] # Revert to main when merged branches: ["*"] pull_request: - # branches: ["main"] # Revert to main when merged branches: ["*"] jobs: @@ -35,7 +30,7 @@ jobs: uses: docker/build-push-action@v4 with: context: . - push: ${{ github.event_name == 'push' }} + push: ${{ github.ref == 'refs/heads/main' }} tags: fribyte/boskonf.no:latest build-args: | APP_BUILD_DATE=${{ github.event.repository.updated_at}}