Skip to content

Commit

Permalink
Change CI to use the version names in Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
aecio committed Jul 18, 2023
1 parent 118d2c2 commit 2ad49e6
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,66 @@ on:
- '[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+'

jobs:
build:
build-images:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
-
name: Login to GitHub Container Registry

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push JupyterHub image

# Creates metadata and tag names for the images named like alpha-automl:{version}-jupyterhub
- name: Extract Docker metadata for [{version}-jupyterhub] image
id: meta_full_jupyterhub
uses: docker/metadata-action@v4
with:
images: ghcr.io/vida-nyu/alpha-automl
tags: |
type=match,pattern=[0-9]+\.[0-9]+\.[0-9]+.*
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'devel') }}
flavor: |
latest=false
suffix=-jupyterhub
# Creates metadata and tag names for the images named like alpha-automl:{version}
- name: Extract Docker metadata for [{version}] image
id: meta_full
uses: docker/metadata-action@v4
with:
images: ghcr.io/vida-nyu/alpha-automl
tags: |
type=match,pattern=[0-9]+\.[0-9]+\.[0-9]+.*
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'devel') }}
flavor: |
latest=false
# Builds and pushes images named like alpha-automl:{version}-jupyterhub
- name: Build and push JupyterHub image [ghcr.io/vida-nyu/alpha-automl:{version}-jupyterhub]
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
target: alpha-automl-jupyterhub
push: true
tags: ghcr.io/vida-nyu/alpha-automl:latest-jupyterhub
-
name: Build and push Jupyter Notebook image
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta_full_jupyterhub.outputs.tags }}
labels: ${{ steps.meta_full_jupyterhub.outputs.labels }}

# Builds and pushes images named like alpha-automl:{version}
- name: Build and push Jupyter Notebook image [ghcr.io/vida-nyu/alpha-automl:{version}]
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
target: alpha-automl
push: true
tags: ghcr.io/vida-nyu/alpha-automl:latest
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta_full.outputs.tags }}
labels: ${{ steps.meta_full.outputs.labels }}

0 comments on commit 2ad49e6

Please sign in to comment.