Skip to content

Commit

Permalink
CI docker image generation (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
iparask authored Nov 26, 2024
1 parent e15f99b commit 7e6a519
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Formatting

on: [push, pull_request]
on: [push, pull_request, release]

jobs:
lint:
Expand All @@ -12,4 +12,4 @@ jobs:
with:
options: "--check --verbose"
- uses: isort/isort-action@master
continue-on-error: true
continue-on-error: true
33 changes: 14 additions & 19 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
name: Tests

on: [push, pull_request, pull_request_target]
on: [push, pull_request, pull_request_target, release]

jobs:
Test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"

- run: pip install -e ".[dev]"

- run: pytest --cov --cov-append

- uses: coverallsapp/github-action@v2
with:
file: .coverage
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- run: pip install -e ".[dev]"
- run: pytest --cov --cov-append
- uses: coverallsapp/github-action@v2
with:
file: .coverage
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: release
on:
release:
types: [created]
workflow_run:
workflows: ["Formatting", "Tests"]
types:
- completed

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: ./Dockerfile
push: false
tags: simonsobs/librarian:${{ github.event.release.tag_name }}

0 comments on commit 7e6a519

Please sign in to comment.