Skip to content

Commit

Permalink
Split up runners
Browse files Browse the repository at this point in the history
  • Loading branch information
bdhoine committed Dec 11, 2024
1 parent f763de6 commit b1abb45
Showing 1 changed file with 9 additions and 64 deletions.
73 changes: 9 additions & 64 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,18 @@
name: Create and publish AEM images

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

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
AEM_SDK_VERSION: 2024.10.18459.20241031T210302Z-241000
registry: ghcr.io
image_name: ${{ github.repository }}
aem_sdk_version: 2024.10.18459.20241031T210302Z-241000

jobs:
build-and-push-image:
name: Build and push AEM image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
build-images:
strategy:
matrix:
runmode: ["author", "publish"]
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache SDK
uses: actions/cache@v4
with:
path: aem-sdk-artifacts
key: aem-sdk-${{ env.AEM_SDK_VERSION }}.zip
- name: Checkout AEM SDK artifacts repository
uses: actions/checkout@v4
with:
repository: orbinson/aem-sdk-artifacts
lfs: true
token: ${{ secrets.PRIVATE_TOKEN }}
path: aem-sdk-artifacts
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push docker image
id: push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ matrix.runmode }}-${{ env.AEM_SDK_VERSION }}
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}
build-args: |
RUNMODE=${{ matrix.runmode }}
PORT=${{ matrix.runmode == 'author' && '4502' || '4503' }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

- run: |
echo ${{ env.registry }}/${{ env.image_name }}:${{ env.aem_sdk_version }}-$(uname -m)

0 comments on commit b1abb45

Please sign in to comment.