-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (102 loc) · 3.62 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Create and publish AEM images
on: [ push ]
env:
registry: ghcr.io
aem_sdk_version: 2024.10.18459.20241031T210302Z-241000
jobs:
build-images:
name: Build images
permissions:
contents: read
packages: write
attestations: write
id-token: write
# strategy:
# matrix:
# arch: [ arm64, amd64 ]
# runmode: [ author, publish ]
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache SDK
uses: actions/cache@v4
id: cache-sdk
with:
path: aem-sdk-artifacts
key: aem-sdk-${{ env.aem_sdk_version }}.zip
- name: Checkout AEM SDK artifacts repository
if: steps.cache-sdk.outputs.cache-hit != 'true'
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
# with:
# platforms: linux/arm64
- name: Log in to container registry
if: github.ref_name == github.event.repository.default_branch
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@v5
# with:
# images: ${{ env.registry }}/${{ github.repository }}
- name: Install docker
run: |
brew install colima docker
colima start --vm-type=vz
# sudo ln -sf /Users/$USER/.colima/docker.sock /var/run/docker.sock
docker --version
IMAGE=${{ env.registry }}/${{ github.repository }}:author-${{ env.aem_sdk_version }}-arm64
docker build --build-arg TARGETARCH=arm64 --build-arg RUNMODE=author --build-arg PORT=4502 -t $IMAGE .
# - name: Build docker image
# id: push
# uses: docker/build-push-action@v5
# with:
# context: .
# push: false
# tags: ${{ env.registry }}/${{ github.repository }}:${{ matrix.runmode }}-${{ env.aem_sdk_version }}-${{ matrix.arch }}
# platforms: linux/${{ matrix.arch }}
# labels: ${{ steps.meta.outputs.labels }}
# load: true
# build-args: |
# RUNMODE=${{ matrix.runmode }}
# PORT=${{ matrix.runmode == 'author' && '4502' || '4503' }}
# - name: Push image to registry
# if: github.ref_name == github.event.repository.default_branch
# run: docker push ${{ env.registry }}/${{ github.repository }}:${{ matrix.runmode }}-${{ env.aem_sdk_version }}-${{ matrix.arch }}
# manifest:
# name: Create manifest
# if: github.ref_name == github.event.repository.default_branch
# permissions:
# packages: write
# id-token: write
# strategy:
# matrix:
# runmode: [ author, publish ]
# runs-on: ubuntu-latest
# needs: build-images
# steps:
# - name: Log in to container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.registry }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Push manifest to registry
# run: |
# IMAGE=${{ env.registry }}/${{ github.repository }}:${{ matrix.runmode }}-${{ env.aem_sdk_version }}
# docker manifest create \
# ${IMAGE} \
# --amend ${IMAGE}-amd64 \
# --amend ${IMAGE}-arm64