Skip to content

Commit

Permalink
Test before pushing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccmaymay committed Oct 20, 2023
1 parent c70c136 commit cc37a10
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
branches:
- 'main'

env:
DOCKER_REPO: hltcoe/concrete-python
TEST_TAG: hltcoe/concrete-python:ci-test

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
Expand All @@ -42,20 +46,30 @@ jobs:
id: meta
uses: docker/metadata-action@35e9aff4f5d665b5aa8a8f2adffaf8a1b5f49cc0
with:
images: hltcoe/concrete-python
images: ${{ env.DOCKER_REPO }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}},priority=2000
- name: Build and export to Docker
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}

- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }} tox -e pep8,py
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit cc37a10

Please sign in to comment.