Skip to content

Commit a6b31e8

Browse files
committed
fix(ci): revert workflow changes and just use a hosted runner for now
1 parent 2a1af7c commit a6b31e8

File tree

2 files changed

+35
-66
lines changed

2 files changed

+35
-66
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,90 +12,62 @@ jobs:
1212
test-build:
1313
name: Test Build on Pull Request
1414
if: github.event_name == 'pull_request'
15-
runs-on: self-hosted
15+
runs-on: builder
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919

20-
- name: Build image for testing
21-
uses: redhat-actions/buildah-build@v2
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Build Docker image for testing
24+
uses: docker/build-push-action@v6
2225
with:
23-
image: podmortem-log-parser-test
24-
tags: latest
25-
containerfiles: |
26-
./src/main/docker/Dockerfile.native
26+
context: .
27+
file: ./src/main/docker/Dockerfile.native
28+
platforms: linux/amd64
29+
push: false
30+
cache-from: type=gha
31+
cache-to: type=gha,mode=max
2732
build-args: |
2833
GITHUB_USER=${{ github.actor }}
2934
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
3035
3136
build-and-push:
3237
name: Build and Push on Main
3338
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
34-
runs-on: self-hosted
39+
runs-on: builder
3540
permissions:
3641
contents: read
3742
packages: write
43+
3844
steps:
3945
- name: Checkout repository
4046
uses: actions/checkout@v4
4147

42-
- name: Set up QEMU
43-
uses: docker/setup-qemu-action@v3
44-
45-
- name: Build AMD64 image
46-
id: build-amd64
47-
uses: redhat-actions/buildah-build@v2
48-
with:
49-
image: ghcr.io/${{ github.repository_owner }}/podmortem-log-parser
50-
tags: latest-amd64 ${{ github.sha }}-amd64
51-
containerfiles: |
52-
./src/main/docker/Dockerfile.native
53-
build-args: |
54-
GITHUB_USER=${{ github.actor }}
55-
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
56-
TARGETARCH=amd64
57-
TARGETOS=linux
58-
59-
- name: Build ARM64 image
60-
id: build-arm64
61-
uses: redhat-actions/buildah-build@v2
62-
with:
63-
image: ghcr.io/${{ github.repository_owner }}/podmortem-log-parser
64-
tags: latest-arm64 ${{ github.sha }}-arm64
65-
containerfiles: |
66-
./src/main/docker/Dockerfile.native
67-
build-args: |
68-
GITHUB_USER=${{ github.actor }}
69-
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
70-
TARGETARCH=arm64
71-
TARGETOS=linux
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v3
7250

73-
- name: Push AMD64 image
74-
uses: redhat-actions/push-to-registry@v2
51+
- name: Log in to the GitHub Container Registry
52+
uses: docker/login-action@v3
7553
with:
76-
image: ${{ steps.build-amd64.outputs.image }}
77-
tags: ${{ steps.build-amd64.outputs.tags }}
7854
registry: ghcr.io
7955
username: ${{ github.actor }}
8056
password: ${{ secrets.GH_PAT }}
8157

82-
- name: Push ARM64 image
83-
uses: redhat-actions/push-to-registry@v2
58+
- name: Build and push Docker image
59+
id: build-and-push
60+
uses: docker/build-push-action@v6
8461
with:
85-
image: ${{ steps.build-arm64.outputs.image }}
86-
tags: ${{ steps.build-arm64.outputs.tags }}
87-
registry: ghcr.io
88-
username: ${{ github.actor }}
89-
password: ${{ secrets.GH_PAT }}
90-
91-
- name: Create and push manifest list
92-
run: |
93-
buildah manifest create ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest
94-
buildah manifest add ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest-amd64
95-
buildah manifest add ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest-arm64
96-
buildah manifest push --all ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest docker://ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest
97-
98-
buildah manifest create ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}
99-
buildah manifest add ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }} ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}-amd64
100-
buildah manifest add ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }} ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}-arm64
101-
buildah manifest push --all ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }} docker://ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}
62+
context: .
63+
file: ./src/main/docker/Dockerfile.native
64+
platforms: linux/amd64,linux/arm64
65+
push: true
66+
cache-from: type=gha
67+
cache-to: type=gha,mode=max
68+
tags: |
69+
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest
70+
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}
71+
build-args: |
72+
GITHUB_USER=${{ github.actor }}
73+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}

src/main/docker/Dockerfile.native

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
ARG TARGETARCH
2-
ARG TARGETOS
3-
4-
FROM registry.access.redhat.com/quarkus/mandrel-for-jdk-21-rhel8:23.1-${TARGETOS}.${TARGETARCH} AS build
1+
FROM registry.access.redhat.com/quarkus/mandrel-for-jdk-21-rhel8:23.1 AS build
52
WORKDIR /home/quarkus
63

74
COPY --chown=quarkus:quarkus mvnw .
@@ -18,7 +15,7 @@ ENV GITHUB_TOKEN=$GITHUB_TOKEN
1815

1916
RUN ./mvnw --no-transfer-progress -s src/main/resources/settings.xml -U package -Dnative
2017

21-
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest.${TARGETOS}.${TARGETARCH}
18+
FROM registry.access.redhat.com/ubi9/ubi-minimal
2219

2320
WORKDIR /work/
2421
COPY --from=build /home/quarkus/target/*-runner /work/application

0 commit comments

Comments
 (0)