Skip to content

Commit

Permalink
Merge pull request #57 from VIDA-NYU/0.3.0-dockerbuild
Browse files Browse the repository at this point in the history
Change CI to use the version names in Docker images
  • Loading branch information
EdenWuyifan authored Jul 18, 2023
2 parents d2aef7d + 85373f6 commit 0a65e4a
Showing 1 changed file with 51 additions and 15 deletions.
66 changes: 51 additions & 15 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,74 @@ 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: |
# tags that named after release versions
type=match,pattern=[0-9]+\.[0-9]+\.[0-9]+.*
# all branches (that pass the 'on: push' trigger filter)
type=ref,enable=true,event=branch
# create latest only for devel branch
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: |
# tags that named after release versions
type=match,pattern=[0-9]+\.[0-9]+\.[0-9]+.*
# all branches (that pass the 'on: push' trigger filter)
type=ref,enable=true,event=branch
# create latest only for devel branch
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 0a65e4a

Please sign in to comment.