Skip to content

Commit

Permalink
Update docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sgouache authored Nov 29, 2023
1 parent 1b45031 commit 7050d79
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Build container

env:
OWNER: khiopsml
IMAGE_NAME: ${{ github.event.repository.name }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# For more details on events that trigger workflows see:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
Expand Down Expand Up @@ -39,28 +40,32 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-dev-container:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # to write in the Github package registry
steps:
- name: Checkout khiops-server sources
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v2
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
file: ./Dockerfile
tags: ghcr.io/khiopsml/khiops-server/server:latest
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Display the image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit 7050d79

Please sign in to comment.