Skip to content

Commit

Permalink
break out workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nina Bernick committed Jun 5, 2024
1 parent 1fde7f4 commit bd4bc01
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 12 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and push docker image

on:
push:
branches:
- main

jobs:
build-and-push:
name: Build and push docker image
runs-on: ubuntu-latest

steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: install poetry
run: |
python -m pip install --no-cache-dir poetry==1.8 supervisor
- name: set up docker
run: |
make gha-setup
- name: Log in 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
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 }}:latest
16 changes: 4 additions & 12 deletions .github/workflows/ci.yml → .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:
python -m pip install --no-cache-dir poetry==1.8 supervisor
- name: set up docker
run: |
make gha-setup
run: make gha-setup

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -45,15 +44,8 @@ jobs:
- 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 }}:${{ github.sha }},
ghcr.io/${{ github.repository }}:latest
- name: Build docker image
run: make build

- name: run tests
run: |
make test
run: make test

0 comments on commit bd4bc01

Please sign in to comment.