Skip to content

Commit

Permalink
Clean up workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
samhclark committed Sep 22, 2024
1 parent c37d499 commit 7cdff0a
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ on:
workflow_dispatch:

jobs:
build_custom_silverblue:
name: main
build-custom-silverblue:
name: Build, sign, then push
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false

steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
- name: Checkout
uses: actions/checkout@v4

- name: Install cosign
Expand All @@ -28,9 +25,8 @@ jobs:
with:
cosign-release: 'v2.4.0'

# Build image using Buildah action
- name: Build Image
id: build_image
- name: Build image
id: build
uses: redhat-actions/buildah-build@v2
with:
containerfiles: |
Expand All @@ -39,7 +35,6 @@ jobs:
tags: |
${{ github.sha }}
40
oci: false
- name: Log in to GitHub Container Registry
uses: redhat-actions/podman-login@v1
Expand All @@ -49,18 +44,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io/${{ github.repository_owner }}

- name: Push To GHCR
- name: Push to GitHub Container Registry
uses: redhat-actions/push-to-registry@v2
id: push
if: github.event_name != 'pull_request'
if: ${{ github.event_name != 'pull_request' }}
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}
extra-args: |
--disable-content-trust

- name: Sign the published OCI image
if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -72,8 +63,7 @@ jobs:
| jq -r '.[]'
| xargs -I {} cosign sign --yes "{}@${digest}"
- name: Echo outputs
- name: Echo outputs for auditing
if: github.event_name != 'pull_request'
run: |
echo "${{ toJSON(steps.push.outputs) }}"

0 comments on commit 7cdff0a

Please sign in to comment.