Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(container): fixup multiarch build, refactor #437

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ env:
CI_IMG: quay.io/cryostat/cryostat-agent-init

jobs:
build-agent:
build-container:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'cryostatio' }}
outputs:
image-version: ${{ steps.get-agent-version.outputs.agent-version }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- id: get-agent-version
- name: Install qemu
run: |
echo "agent-version=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version)" >> $GITHUB_OUTPUT
sudo apt-get update
sudo apt-get install -y qemu-user-static
- uses: actions/setup-java@v4
with:
java-version: '11'
Expand All @@ -43,36 +42,18 @@ jobs:
path: ~/.m2
key: ${{ runner.os }}-build-${{ hashFiles('**/pom.xml') }}
- run: mvn -B -U clean install

build-container:
needs: [build-agent]
runs-on: ubuntu-latest
env:
agent-version: ${{ needs.build-agent.outputs.image-version }}
name: Build container image
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- id: get-agent-version
run: |
echo "agent-version=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version)" >> $GITHUB_OUTPUT
- name: Get date tag
run: echo "DATE_TAG=$(date -uI)" >> "$GITHUB_ENV"
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-build-${{ hashFiles('**/pom.xml') }}
- run: mvn -B -U clean install
- name: Build container images and manifest
id: buildah-build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.CI_IMG }}
archs: amd64, arm64
tags: ${{ env.agent-version }} ${{env.DATE_TAG}} latest
tags: ${{ steps.get-agent-version.outputs.agent-version }} ${{env.DATE_TAG}} latest
containerfiles: |
src/main/container/Dockerfile
- name: Push to quay.io
Expand Down
Loading