From b7427244227ea2a842a8f457114c53fdee59518c Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Sun, 20 Oct 2024 18:13:22 +0200 Subject: [PATCH] Rewrite github action --- .github/workflows/build.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70ab685..be504c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ -name: build +name: Build on: [push, pull_request] jobs: - build: + test: runs-on: ubuntu-latest steps: @@ -18,8 +18,15 @@ jobs: LICENSE_KEY: ${{ secrets.LICENSE_KEY }} RUN_INTERVAL: "false" run: npm test - - name: Publish image - uses: elgohr/Publish-Docker-Github-Action@v5 + + publish: + needs: test + if: github.event_name == 'push' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: elgohr/Publish-Docker-Github-Action@v5 with: name: hakanensari/country username: ${{ secrets.DOCKER_USERNAME }}