Skip to content

Commit

Permalink
Merge pull request #16 from Antvirf/ci/test-build-on-pr
Browse files Browse the repository at this point in the history
ci: build container without pushing on PRs against main
  • Loading branch information
Antti authored Jan 8, 2024
2 parents 2c2871f + 1d0e37e commit 4036d54
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:

permissions:
Expand All @@ -33,13 +36,13 @@ jobs:
- name: Set REGISTRY env variable
run: echo "REGISTRY=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and push
- name: Build container image
uses: docker/build-push-action@v4
id: build-image
with:
context: ./.
file: ./Dockerfile
push: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{env.REGISTRY}}:${{github.run_number}}, ${{env.REGISTRY}}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 4036d54

Please sign in to comment.