Skip to content

Commit 587a0a2

Browse files
committed
Build to image to quay.io, ISOs to S3, sign with KMS
1 parent 162f173 commit 587a0a2

File tree

4 files changed

+48
-35
lines changed

4 files changed

+48
-35
lines changed

.github/actions/config/action.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
---
22
name: Set Environment Variables
33

4-
inputs:
5-
SIGNING_SECRET:
6-
description: "The secret used for signing the image. If not provided, the image will not be signed."
7-
required: false
8-
94
outputs:
105
LATEST_TAG:
116
description: "The latest tag based on the event type"
@@ -46,10 +41,10 @@ runs:
4641
echo "LATEST_TAG=latest" >> $GITHUB_OUTPUT
4742
fi
4843
49-
REGISTRY=ghcr.io
50-
REGISTRY_USER=${{ github.actor }}
51-
IMAGE_PATH=${{ github.repository_owner }}
52-
IMAGE_NAME=${{ github.event.repository.name }}
44+
REGISTRY=quay.io
45+
REGISTRY_USER="almalinuxorg+airibarr_bot"
46+
IMAGE_PATH="almalinuxorg"
47+
IMAGE_NAME="atomic-workstation"
5348
PLATFORMS="amd64"
5449
5550
echo "REGISTRY=${REGISTRY}" >> $GITHUB_OUTPUT
@@ -59,13 +54,4 @@ runs:
5954
echo "IMAGE_REF=${REGISTRY}/${IMAGE_PATH}/${IMAGE_NAME}" >> $GITHUB_OUTPUT
6055
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_OUTPUT
6156
62-
# This is a workaround so that the expansion of SIGNING_SECRET doesn't break the if statement
63-
SECRET=$(cat <<EOF
64-
${{ inputs.SIGNING_SECRET }}
65-
EOF
66-
)
67-
if [ -z "${SECRET}" ]; then
68-
echo "IS_SIGNED=false" >> $GITHUB_OUTPUT
69-
else
70-
echo "IS_SIGNED=true" >> $GITHUB_OUTPUT
71-
fi
57+
echo "IS_SIGNED=true" >> $GITHUB_OUTPUT
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Dependabot auto-approve
2+
on: pull_request_target
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v2.4.0
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
19+
- name: Enable auto-merge for Dependabot PRs
20+
if: ${{ contains(steps.metadata.outputs.package-ecosystem, 'docker') }}
21+
run: gh pr merge --auto --merge "$PR_URL"
22+
env:
23+
PR_URL: ${{github.event.pull_request.html_url}}
24+
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}

.github/workflows/build-iso.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ concurrency:
1010

1111
jobs:
1212
set-env:
13-
if: github.repository != 'AlmaLinux/atomic-respin-template'
1413
runs-on: ubuntu-latest
1514
outputs:
1615
LATEST_TAG: ${{ steps.set.outputs.LATEST_TAG }}
@@ -28,12 +27,10 @@ jobs:
2827
- name: Set environment variables
2928
uses: ./.github/actions/config
3029
id: set
31-
with:
32-
SIGNING_SECRET: ${{ secrets.SIGNING_SECRET }}
3330

3431
build-iso:
3532
name: Build ISO
36-
needs: [set-env]
33+
needs: set-env
3734
uses: AlmaLinux/atomic-ci/.github/workflows/build-iso.yml@v6
3835
with:
3936
image-name: "${{ needs.set-env.outputs.IMAGE_NAME }}"
@@ -44,10 +41,15 @@ jobs:
4441
platforms: ${{ needs.set-env.outputs.PLATFORMS }}
4542
REGISTRY: ${{ needs.set-env.outputs.REGISTRY }}
4643
REGISTRY_USER: ${{ needs.set-env.outputs.REGISTRY_USER }}
44+
upload-to-github: false
4745
upload-to-cloudflare: false
48-
# bucket: ${{ secrets.R2_BUCKET }}
46+
upload-to-s3: true
47+
bucket: "almalinux-atomic"
48+
aws-default-region: "us-east-1"
4949
secrets:
50-
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
# R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
52-
# ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
53-
# SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
50+
REGISTRY_TOKEN: ${{ secrets.QUAY_PASSWORD }}
51+
AWS_ROLE_ARN: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/SIG_Atomic_GHA
52+
permissions:
53+
id-token: write
54+
contents: read
55+
packages: write

.github/workflows/build.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ concurrency:
1616

1717
jobs:
1818
set-env:
19-
if: github.repository != 'AlmaLinux/atomic-respin-template'
2019
runs-on: ubuntu-latest
2120
outputs:
2221
LATEST_TAG: ${{ steps.set.outputs.LATEST_TAG }}
@@ -34,8 +33,6 @@ jobs:
3433
- name: Set environment variables
3534
uses: ./.github/actions/config
3635
id: set
37-
with:
38-
SIGNING_SECRET: ${{ secrets.SIGNING_SECRET }}
3936

4037
build-image:
4138
name: Build image
@@ -51,9 +48,12 @@ jobs:
5148
image-path: ${{ needs.set-env.outputs.IMAGE_PATH }}
5249
REGISTRY: ${{ needs.set-env.outputs.REGISTRY }}
5350
REGISTRY_USER: ${{ needs.set-env.outputs.REGISTRY_USER }}
51+
KMS_KEY_ID: SIG_Atomic_Container_Signing_GH_CI
52+
AWS_REGION: us-east-1
53+
generate-sbom: false
5454
secrets:
55-
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56-
SIGNING_SECRET: ${{ secrets.SIGNING_SECRET }}
55+
REGISTRY_TOKEN: ${{ secrets.QUAY_PASSWORD }}
56+
AWS_ROLE_ARN: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/SIG_Atomic_GHA
5757
permissions:
5858
contents: read
5959
packages: write
@@ -69,7 +69,7 @@ jobs:
6969

7070
steps:
7171
- name: Login to Container Registry
72-
run: echo ${{ secrets.GITHUB_TOKEN }} | podman login -u ${{ needs.set-env.outputs.REGISTRY_USER }} --password-stdin ${{ needs.set-env.outputs.REGISTRY }}
72+
run: echo ${{ secrets.QUAY_PASSWORD }} | podman login -u ${{ needs.set-env.outputs.REGISTRY_USER }} --password-stdin ${{ needs.set-env.outputs.REGISTRY }}
7373

7474
- name: Test container
7575
run: |
@@ -95,12 +95,13 @@ jobs:
9595
image: ${{ needs.build-image.outputs.image-ref }}@${{ needs.build-image.outputs.digest }}
9696
tag: |
9797
${{ needs.set-env.outputs.LATEST_TAG }}
98+
${{ needs.build-image.outputs.major-version }}
9899
${{ needs.build-image.outputs.redhat-version-id }}
99100
${{ needs.build-image.outputs.version }}
100101
REGISTRY: ${{ needs.set-env.outputs.REGISTRY }}
101102
REGISTRY_USER: ${{ needs.set-env.outputs.REGISTRY_USER }}
102103
secrets:
103-
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
REGISTRY_TOKEN: ${{ secrets.QUAY_PASSWORD }}
104105
permissions:
105106
packages: write
106107

0 commit comments

Comments
 (0)