Skip to content

Commit

Permalink
Switch to Buildah image generation
Browse files Browse the repository at this point in the history
  • Loading branch information
skyblaster authored Aug 24, 2024
1 parent c2f13b3 commit 03eafe6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 90 deletions.
90 changes: 0 additions & 90 deletions .github/workflows/docker-publish.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/ghcr-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: OCI Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
IMAGE_NAME: caddy-cloudflare
IMAGE_TAGS: latest ${{ github.sha }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}

jobs:
push-ghcr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

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

# Build image using Buildah action
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAGS }}
containerfiles: |
./Containerfile
# Push the image to GHCR (Image Registry)
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
id: push
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
extra-args: |
--disable-content-trust

0 comments on commit 03eafe6

Please sign in to comment.