Skip to content

Commit

Permalink
gh actions: image build for forks
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed May 2, 2024
1 parent 41d7a7e commit 66679d2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
run: echo "$GITHUB_CONTEXT"
build:
name: Build
# for tags and not forks
# for regulars pushes, tags and not forks
if: |
(startsWith(github.ref, 'refs/tags/')) ||
(!startsWith(github.ref, 'refs/tags/') &&
github.event.pull_request.head.repo.full_name == github.repository)
github.event.repository.full_name == github.repository)
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -84,11 +84,11 @@ jobs:
retention-days: 1
merge:
runs-on: ubuntu-latest
# for tags and not forks
# for regulars pushes, tags and not forks
if: |
(startsWith(github.ref, 'refs/tags/')) ||
(!startsWith(github.ref, 'refs/tags/') &&
github.event.pull_request.head.repo.full_name == github.repository)
github.event.repository.full_name == github.repository)
needs:
- build
steps:
Expand Down Expand Up @@ -131,9 +131,9 @@ jobs:
docker run --rm -t ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} limitador-server --help
build-from-forks:
name: Build on forks
# for forks
if: |
!startsWith(github.ref, 'refs/tags/') &&
github.event.pull_request.head.repo.full_name == github.repository
github.event.repository.full_name != github.repository)
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand All @@ -146,3 +146,6 @@ jobs:
tags: ${{ github.sha }}
dockerfiles: |
./Dockerfile
- name: Smoke Test
run: |
docker run --rm -t limitador:${{ github.sha }} limitador-server --help

0 comments on commit 66679d2

Please sign in to comment.