Skip to content

Commit

Permalink
use build-and-push action
Browse files Browse the repository at this point in the history
  • Loading branch information
Nina Bernick committed Jun 3, 2024
1 parent e9a92af commit a9da4b7
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build docker image and push to gchr.io
run: |
TAG=$(git describe --long --tags --always --dirty)
IMAGE_NAME=platformics
IMAGE_URI="ghcr.io/${GITHUB_REPOSITORY}/${IMAGE_NAME}"
make build
docker push "${IMAGE_URI}:${TAG}"
if [[ ${GITHUB_REF##*/} == "main" ]]; then
docker tag "${IMAGE_URI}:${TAG}" "${IMAGE_URI}:latest"
docker push "${IMAGE_URI}:latest"
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Clean previous builds
run: rm -rf dist/*.whl

- name: Build with Poetry
run: poetry build

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/my-image:latest

- name: run tests
run: |
Expand Down

0 comments on commit a9da4b7

Please sign in to comment.