Skip to content

Commit 0a12015

Browse files
authored
Updated release workflow, changed docker registry. (#228)
1 parent d8bac3b commit 0a12015

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

.github/workflows/docker.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Release python package
22

33
on:
4-
push:
5-
tags:
6-
- "*"
4+
release:
5+
types:
6+
- released
77

88
jobs:
9-
deploy:
9+
pypi:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
@@ -15,10 +15,38 @@ jobs:
1515
- name: Set up Python
1616
uses: actions/setup-python@v4
1717
with:
18-
python-version: "3.9"
18+
python-version: "3.11"
1919
- name: Install deps
2020
run: poetry install
21+
- name: Set version
22+
run: poetry version "${{ github.ref_name }}"
2123
- name: Release package
2224
env:
2325
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
24-
run: poetry publish --build
26+
run: poetry publish --build
27+
docker:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
packages: write
31+
contents: read
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
- name: Set up Docker
36+
uses: docker/setup-qemu-action@v3
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v2
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Build and push
46+
uses: docker/build-push-action@v2
47+
with:
48+
context: .
49+
file: ./Dockerfile
50+
platforms: linux/amd64
51+
push: true
52+
tags: ghcr.io/s3rius/fastapi_template:latest,ghcr.io/s3rius/fastapi_template:${{ github.ref_name }}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fastapi_template"
3-
version = "5.1.2"
3+
version = "0.0.0"
44
description = "Feature-rich robust FastAPI template"
55
authors = ["Pavel Kirilin <win10@list.ru>"]
66
packages = [{ include = "fastapi_template" }]

0 commit comments

Comments
 (0)