-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH Actions: Build with buildah #1
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a3fd898
GH Actions: Build with buildah
jlledom ae0c1b3
Update buildah.yml
jlledom 6425671
Update buildah.yml
jlledom e3e9bee
Update Containerfile
jlledom 6dbd0c2
Set default image tag
jlledom bd27d46
Merge branch 'gh-actions' of github.com:3scale-labs/dnsmasq into gh-a…
jlledom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Build dnsmasq oci container image | ||
|
||
on: | ||
push: | ||
branches: | ||
- gh-actions | ||
workflow_dispatch: | ||
inputs: | ||
custom_tag: | ||
description: optional custom tag on remote repo you want image to be tagged with | ||
required: false | ||
default: 'latest' | ||
type: string | ||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: quay.io | ||
IMAGE_NAME: 3scale/dnsmasq | ||
|
||
jobs: | ||
buildah: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Log in to Red Hat Registry | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.QUAY_USER_NAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch,enable=${{ github.ref_name != 'main' && inputs.custom_tag == '' }} | ||
type=raw,value=latest,enable=${{ github.ref_name == 'main' }} | ||
type=raw,value=nightly,enable=${{ github.ref_name == 'main' }} | ||
${{ inputs.custom_tag }} | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Build image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
layers: false | ||
oci: true | ||
tls-verify: true | ||
extra-args: | | ||
--squash | ||
containerfiles: | | ||
Containerfile | ||
|
||
- name: Echo Outputs | ||
run: | | ||
echo "Image: ${{ steps.build-image.outputs.image }}" | ||
echo "Tags: ${{ steps.build-image.outputs.tags }}" | ||
echo "Tagged Image: ${{ steps.build-image.outputs.image-with-tag }}" | ||
|
||
- name: Check images created | ||
run: buildah images | ||
|
||
- name: Push To quay.io | ||
id: push-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
|
||
- name: Print image url | ||
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi | ||
|
||
LABEL maintainer="3scale system team <[email protected]>" | ||
LABEL org.opencontainers.image.title="dnsmasq", | ||
LABEL org.opencontainers.image.source="https://github.com/3scale/dnsmasq" | ||
LABEL org.opencontainers.image.vendor="3scale" | ||
|
||
FROM registry.access.redhat.com/ubi9/ubi | ||
|
||
RUN dnf -y install dnsmasq | ||
EXPOSE 53 67 69 | ||
ENTRYPOINT ["/usr/sbin/dnsmasq"] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only to this branch? not main/master?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this. It was for testing. I couldn't find another way to make the action run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you have
workflow_dispatch
then you can start it manuallyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't, until the job appeared for the first time in the Actions tab. And for that I had to add the push launcher.