Prepare dockerfiles to support multiple architectures and launching GUIs (arm64 in addition to amd64) #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: github-DOCKER | |
on: | |
pull_request: | |
paths-ignore: | |
- '**/*.rst' | |
- '**/*.md' | |
- 'doc/**' | |
types: [ opened, reopened, synchronize ] | |
push: | |
branches: | |
- main | |
permissions: | |
contents: none | |
env: | |
IMAGE_REGISTRY: "ghcr.io/sandialabs/opencsp" | |
jobs: | |
container_build_matrix: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
strategy: | |
matrix: | |
dockerfile: [Dockerfile, Dockerfile_x11] | |
include: | |
- dockerfile: Dockerfile | |
ARCH: amd64 | |
TAG: ubi8 | |
- dockerfile: Dockerfile_x11 | |
ARCH: amd64 | |
TAG: ubi8-x11 | |
- dockerfile: Dockerfile_x11 | |
ARCH: arm64 | |
TAG: ubi8-x11 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set vars | |
run: | | |
export REV=$(echo "${GITHUB_SHA}" | cut -c1-7) | |
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then | |
export REV=latest | |
fi | |
echo "FULL_TAG=$IMAGE_REGISTRY:${{matrix.TAG }}-${{matrix.ARCH}}-$REV" >> $GITHUB_ENV | |
- name: Build image | |
run: | | |
cp requirements.txt ./docker | |
echo "FULL_TAG=$FULL_TAG" | |
docker build ./docker \ | |
--build-arg="TARGET_ARCH=${{matrix.ARCH}}" \ | |
--file "${{matrix.dockerfile}}" \ | |
--tag "$FULL_TAG" \ | |
--label "runnumber=${GITHUB_RUN_ID}" | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Push image | |
run: | | |
echo "FULL_TAG=$FULL_TAG" | |
docker push "$FULL_TAG" |