Skip to content

Commit

Permalink
enable CI for PR (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemensElflein authored Apr 27, 2024
1 parent 04f01a6 commit 297384d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
Expand All @@ -76,18 +75,16 @@ jobs:
context: .
platforms: ${{ matrix.docker_build_arch }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=ghcr.io/${{env.REPOSITORY_LC}},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
outputs: type=image,name=ghcr.io/${{env.REPOSITORY_LC}},push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Export digest
if: github.event_name != 'pull_request'
run: |
mkdir -p /tmp/digests
digest="${{ steps.build-and-push.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: digests
Expand All @@ -106,17 +103,14 @@ jobs:
env:
REPOSITORY: '${{ github.repository }}'
- name: Download digests
if: github.event_name != 'pull_request'
uses: actions/download-artifact@v3
with:
name: digests
path: /tmp/digests
- name: Set up Docker Buildx
if: github.event_name != 'pull_request'
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
if: github.event_name != 'pull_request'
uses: docker/metadata-action@v4
with:
# generate Docker tags based on the following events/attributes
Expand All @@ -132,18 +126,15 @@ jobs:
images: ghcr.io/${{env.REPOSITORY_LC}}
- name: Login to Docker Hub
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{env.REPOSITORY_LC}}@sha256:%s ' *)
- name: Inspect image
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect ghcr.io/${{env.REPOSITORY_LC}}:${{ steps.meta.outputs.version }}

0 comments on commit 297384d

Please sign in to comment.