Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
feat(ci): Move to Docker
Browse files Browse the repository at this point in the history
Signed-off-by: RJ Trujillo <[email protected]>
  • Loading branch information
EyeCantCU committed May 12, 2024
1 parent 61f1190 commit 8816ffb
Showing 1 changed file with 16 additions and 44 deletions.
60 changes: 16 additions & 44 deletions .github/workflows/reusable-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,57 +144,29 @@ jobs:
# we can retry on that unfortunately common failure case
podman pull quay.io/fedora/fedora-bootc:${{ matrix.fedora_version }}
# Build image using Buildah action
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
archs: ${{ env.ARCHS }}
containerfiles: |
./Containerfile
image: ${{ env.IMAGE_NAME }}
tags: |
${{ steps.generate-tags.outputs.alias_tags }}
build-args: |
IMAGE_NAME=${{ matrix.image_name }}
FEDORA_MAJOR_VERSION=${{ matrix.fedora_version }}
labels: ${{ steps.meta.outputs.labels }}
oci: false

# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.IMAGE_REGISTRY }}

- name: Push To GHCR
uses: Wandalen/[email protected]
id: push
if: github.event_name != 'pull_request'
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
with:
action: redhat-actions/push-to-registry@v2
attempt_limit: 3
attempt_delay: 15000
with: |
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ steps.registry_case.outputs.lowercase }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build/push image using docker buildx action
- name: Build and Push Image
id: build_image
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
context: .
file: ./Containerfile
platforms: linux/aarch64, linux/x86_64
build-args: |
IMAGE_NAME=${{ matrix.image_name }}
FEDORA_MAJOR_VERSION=${{ matrix.fedora_version }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}

# Sign container
- uses: sigstore/[email protected]
if: github.event_name != 'pull_request'
Expand Down

0 comments on commit 8816ffb

Please sign in to comment.