diff --git a/.github/actions/docker-image/action.yaml b/.github/actions/docker-image/action.yaml index 1161906..c370a11 100644 --- a/.github/actions/docker-image/action.yaml +++ b/.github/actions/docker-image/action.yaml @@ -6,6 +6,11 @@ inputs: token: description: Github token required: true + push: + description: Push Images to GHCR + type: boolean + required: false + default: true runs: using: composite @@ -39,14 +44,14 @@ runs: username: ${{ github.actor }} password: ${{ inputs.token }} - - name: Build and Push + - name: Build Docker Image if: github.event_name != 'pull_request' uses: docker/build-push-action@v5 with: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm64 - push: true + push: ${{ fromJSON(inputs.push) }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | diff --git a/.github/workflows/ci.yml b/.github/workflows/on-merge.yml similarity index 74% rename from .github/workflows/ci.yml rename to .github/workflows/on-merge.yml index 7db0f08..2db0c12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/on-merge.yml @@ -1,13 +1,10 @@ --- -name: ci +name: On Merge on: push: - pull_request: - types: - - opened - - reopened - - synchronize + branches: + - master jobs: tests: @@ -21,8 +18,6 @@ jobs: release-image: runs-on: ubuntu-latest - needs: tests - if: github.event_name == 'push' && github.ref_name == 'master' steps: - name: Checkout uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml new file mode 100644 index 0000000..03cea35 --- /dev/null +++ b/.github/workflows/on-pr.yml @@ -0,0 +1,19 @@ +--- +name: On Pull Request + +on: + pull_request: + types: + - opened + - reopened + - synchronize + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + + - name: Tests + uses: ./.github/actions/tests \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/on-release.yml similarity index 97% rename from .github/workflows/release.yml rename to .github/workflows/on-release.yml index 7283741..78ec029 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/on-release.yml @@ -1,5 +1,5 @@ --- -name: release +name: Versioned Release on: push: