-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 11161ed
Showing
6 changed files
with
144 additions
and
0 deletions.
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,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,70 @@ | ||
name: "Build and push container image" | ||
|
||
env: | ||
NAME: "podman-action" | ||
REGISTRY: "quay.io/travier" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 0 * * MON' | ||
|
||
permissions: read-all | ||
|
||
# Prevent multiple workflow runs from racing to ensure that pushes are made | ||
# sequentialy for the main branch. Also cancel in progress workflow runs for | ||
# pull requests only. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
build-push-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build container image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
context: ${{ env.NAME }} | ||
image: ${{ env.NAME }} | ||
tags: latest-cosign | ||
containerfiles: ${{ env.NAME }}/Containerfile | ||
layers: false | ||
oci: true | ||
|
||
- name: Push to Container Registry | ||
uses: redhat-actions/push-to-registry@v2 | ||
id: push | ||
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' | ||
with: | ||
username: ${{ secrets.BOT_USERNAME }} | ||
password: ${{ secrets.BOT_SECRET }} | ||
image: ${{ env.NAME }} | ||
registry: ${{ env.REGISTRY }} | ||
tags: latest-cosign | ||
|
||
- name: Login to Container Registry | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.BOT_USERNAME }} | ||
password: ${{ secrets.BOT_SECRET }} | ||
|
||
- uses: sigstore/[email protected] | ||
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' | ||
|
||
- name: Sign container image | ||
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' | ||
run: | | ||
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ env.REGISTRY }}/${{ env.NAME }}@${{ steps.push.outputs.digest }} | ||
env: | ||
COSIGN_EXPERIMENTAL: false | ||
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} |
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,5 @@ | ||
FROM quay.io/fedora/fedora:latest | ||
|
||
RUN dnf update -y &&\ | ||
dnf install -y podman buildah skopeo &&\ | ||
dnf clean all |
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,19 @@ | ||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice (including the next | ||
paragraph) shall be included in all copies or substantial portions of the | ||
Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS | ||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF | ||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,40 @@ | ||
# Container to run buildah/podman/skopeo commands in GitHub Actions | ||
|
||
## How to use | ||
|
||
TODO | ||
|
||
## Verifying sigstore container signatures with podman | ||
|
||
How to configure sigstore signature verification in podman: | ||
|
||
``` | ||
$ sudo mkdir /etc/pki/containers | ||
$ sudo cp quay-travier-containers.pub /etc/pki/containers/ | ||
$ sudo restorecon -RFv /etc/pki/containers | ||
$ cat /etc/containers/registries.d/quay.io-travier.yaml | ||
docker: | ||
quay.io/travier: | ||
use-sigstore-attachments: true | ||
$ sudo restorecon -RFv /etc/containers/registries.d/quay.io-travier.yaml | ||
$ cat /etc/containers/policy.json | ||
... | ||
"transports": { | ||
"docker": { | ||
"quay.io/travier": [ | ||
{ | ||
"type": "sigstoreSigned", | ||
"keyPath": "/etc/pki/containers/quay-travier-containers.pub", | ||
"signedIdentity": { | ||
"type": "matchRepository" | ||
} | ||
} | ||
], | ||
... | ||
``` | ||
|
||
## License | ||
|
||
See [LICENSE](LICENSE). |
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,4 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEviYlbu3VB0KQ1h97SDbQqndpM04q | ||
Yi/UcUSxoB4ho8gfnw0b61REAtgleIDExQ3+PqEZoXB+nQ+NeAbSDwkHYA== | ||
-----END PUBLIC KEY----- |