Merge pull request #241 from braden6521/sofast_gui_ui #41
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: | |
push: | |
branches: | |
- main | |
- develop | |
permissions: | |
contents: none | |
env: | |
IMAGE_REGISTRY: "ghcr.io/sandialabs/opencsp" | |
jobs: | |
container_build_matrix: | |
runs-on: ubuntu-latest | |
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" | |
permissions: | |
packages: write | |
contents: read |