Skip to content

Commit

Permalink
Use v1.1.0 and change build to support multi arch
Browse files Browse the repository at this point in the history
This commit follows the one happened in kpa-marp-pandoc container to support
multiarch, so that resulting container will be available for both ARM64 and
AMD64.
  • Loading branch information
rascasoft committed Nov 2, 2023
1 parent 27a474a commit 96843f8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 23 deletions.
60 changes: 39 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ name: Linter, test, build and push KPA container

env:
KPA_PROJECT: example
REGISTRY_GHCR: ghcr.io/mmul-it
REGISTRY_QUAY: quay.io/mmul
CONTAINER_NAME: kpa

on: [push,workflow_dispatch]

jobs:
linter:
runs-on: ubuntu-latest
container:
image: ghcr.io/mmul-it/kpa-marp-pandoc:v1.0.0
image: ghcr.io/mmul-it/kpa-marp-pandoc:v1.1.0
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -30,7 +27,7 @@ jobs:
test:
runs-on: ubuntu-latest
container:
image: ghcr.io/mmul-it/kpa-marp-pandoc:v1.0.0
image: ghcr.io/mmul-it/kpa-marp-pandoc:v1.1.0
needs: linter
steps:
- name: Checkout repository
Expand Down Expand Up @@ -61,19 +58,40 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Build the container image
run: docker build .
--file Dockerfile
--tag ${REGISTRY_GHCR}/${CONTAINER_NAME}:${{ github.ref_name }}
--tag ${REGISTRY_GHCR}/${CONTAINER_NAME}:latest
--tag ${REGISTRY_QUAY}/${CONTAINER_NAME}:${{ github.ref_name }}
--tag ${REGISTRY_QUAY}/${CONTAINER_NAME}:latest
- name: Login into the GitHub Container Registry
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ${REGISTRY_GHCR} --username "${{ vars.GHCR_USER }}" --password-stdin
- name: Login into the Quay Container Registry
run: echo "${{ secrets.QUAY_ROBOT_TOKEN }}" | docker login ${REGISTRY_QUAY} --username "${{ vars.QUAY_ROBOT_NAME }}" --password-stdin
- name: Push the image into the GitHub Container Registry
run: docker push --all-tags ${REGISTRY_GHCR}/${CONTAINER_NAME}
- name: Push the image into the Quay Container Registry
run: docker push --all-tags ${REGISTRY_QUAY}/${CONTAINER_NAME}
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ghcr
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ vars.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Login to quay
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ vars.QUAY_ROBOT_NAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
# Check https://github.com/docker/build-push-action/issues/820
provenance: false
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/mmul-it/kpa:latest
ghcr.io/mmul-it/kpa:${{ github.ref_name }}
quay.io/mmul/kpa:latest
quay.io/mmul/kpa:${{ github.ref_name }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dockerfile for KPA project to be used in CI

# Start from kpa-marp-pandoc
FROM ghcr.io/mmul-it/kpa-marp-pandoc:v1.0.0
FROM ghcr.io/mmul-it/kpa-marp-pandoc:v1.1.0

# Create workdir path
RUN mkdir /kpa
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![KPA - The Knowledge Pods Approach](./images/kpa-github-header.png)
# ![KPA - The Knowledge Pods Approach](./images/kpa-github-header.png)

[![GitHub Actions CI](https://github.com/mmul-it/kpa/actions/workflows/main.yml/badge.svg?event=push)](https://github.com/mmul-it/kpa/actions/workflows/main.yml)

Expand Down

0 comments on commit 96843f8

Please sign in to comment.