Skip to content

Commit

Permalink
docs/models/executor
Browse files Browse the repository at this point in the history
  • Loading branch information
robkooper committed Sep 1, 2024
1 parent c7a4fb5 commit 513fc19
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,115 @@ jobs:
name: base
path: /tmp/base.tar

# ----------------------------------------------------------------------
# Next are images that depend on base image
# ----------------------------------------------------------------------
baseplus:
runs-on: ubuntu-latest
needs: base
permissions:
packages: write
strategy:
fail-fast: false
matrix:
name:
- docs
- models
- executor
include:
- name: docs
CONTEXT: .
DOCKERFILE: docker/docs/Dockerfile
PLATFORM: "linux/amd64"
IMAGE: docs
- name: models
CONTEXT: docker/models
DOCKERFILE: docker/models/Dockerfile
PLATFORM: "linux/amd64"
IMAGE: models
- name: executor
CONTEXT: docker/executor
DOCKERFILE: docker/executor/Dockerfile
PLATFORM: "linux/amd64"
IMAGE: executor

steps:
- uses: actions/checkout@v4

# load cached image
- name: Retrieve compiled binary
uses: actions/download-artifact@v4
with:
name: base
path: /tmp
- name: Load image
run: docker load --input /tmp/base.tar

# create metadata for image
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
pecan/${{ matrix.IMAGE }}
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/${{ matrix.IMAGE }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# setup docker build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Inspect Builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
# login to registries
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# build the docker images
- name: Build and push ${{ matrix.name }}
uses: docker/build-push-action@v6
with:
context: ${{ matrix.CONTEXT }}
file: ${{ matrix.DOCKERFILE }}
#push: ${{ github.event_name != 'pull_request' }}
#push: true
platforms: ${{ matrix.PLATFORM }}
cache-from: type=registry,ref=pecan/${{ matrix.IMAGE }}:buildcache
cache-to: type=registry,ref=pecan/${{ matrix.IMAGE }}:buildcache,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ steps.meta.outputs.version }}
R_VERSION=${{ env.R_VERSION }}
# ----------------------------------------------------------------------
# Next are images that do not depend on either depends or base image
# ----------------------------------------------------------------------
Expand Down

0 comments on commit 513fc19

Please sign in to comment.