Skip to content

Commit

Permalink
add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
hoptical committed Feb 17, 2024
1 parent f992255 commit 4f34b6b
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .github/release.yml

changelog:
categories:
- title: Bug Fixes 🐛
labels:
- bug
- title: Breaking Changes 🛠
labels:
- Semver-Major
- breaking-change
- title: Exciting New Features 🎉
labels:
- Semver-Minor
- enhancement
- title: Other Changes
labels:
- "*"
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: pytest -v
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags:
- "v*.*.*" # Run workflow on version tags, e.g. v1.0.0.

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v3

- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository }}

- uses: docker/build-push-action@v4
with:
file: "Dockerfile"
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

release:
needs: build-and-push
name: release
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: release
run: gh release create ${{ github.ref_name }} --generate-notes --verify-tag

0 comments on commit 4f34b6b

Please sign in to comment.