Skip to content

Commit 9e4e138

Browse files
committed
testing publisher
1 parent d7a3a83 commit 9e4e138

File tree

6 files changed

+147
-0
lines changed

6 files changed

+147
-0
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build Docker Image
2+
on:
3+
workflow_call:
4+
5+
6+
jobs:
7+
# Build Docker Image
8+
build:
9+
name: Build Docker Image
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Build Docker Image
17+
run: |
18+
docker build -t awesome-fastapi:${{ github.sha }} .
19+

.github/workflows/main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Main Workflow
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
security-events: write
11+
actions: read
12+
13+
14+
jobs:
15+
# Add Publisher Job here
16+
publish:
17+
uses: ./.github/workflows/publish.yml

.github/workflows/pr.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: PR Workflow
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
- reopened
9+
10+
permissions:
11+
contents: read
12+
security-events: write
13+
actions: read
14+
15+
jobs:

.github/workflows/publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish Artifacts
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
pypi-publish:
8+
name: Upload Release to PyPI
9+
runs-on: ubuntu-latest
10+
# Specifying a GitHub environment is optional, but strongly encouraged
11+
environment: pypi
12+
permissions:
13+
# IMPORTANT: this permission is mandatory for Trusted Publishing
14+
id-token: write
15+
steps:
16+
# retrieve your distributions here
17+
- name: Publish package distributions to PyPI
18+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/push-image.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Push Contianer to Docker Hub
2+
on:
3+
workflow_call:
4+
5+
6+
jobs:
7+
8+
docker:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: login to Docker Hub
13+
uses: docker/login-action@v3
14+
with:
15+
username: ${{ secrets.DOCKERHUB_USERNAME }}
16+
password: ${{ secrets.DOCKERHUB_TOKEN }}
17+
-
18+
name: Set up QEMU
19+
uses: docker/setup-buildx-action@v3
20+
-
21+
name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
-
24+
name: Build and Push
25+
uses: docker/build-push-action@v6
26+
with:
27+
push: true
28+
tags: user/app:latest
29+

.github/workflows/syntax.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Linting and Formating Checks
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
# Run Pylint and Black formatter
7+
pylint:
8+
name: Run lint and formatting checks with pylint and black
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.12.6"]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: 'Setup Python ${{ matrix.python-version}}'
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: '${{ matrix.python-version}}'
20+
21+
- name: Install dependencies
22+
run: |
23+
pip install -r requirements.txt
24+
python -m pip install --upgrade pip
25+
26+
- name: Run pylint
27+
run: pylint .
28+
29+
black:
30+
name: Run black formatter
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
python-version: ["3.12.6"]
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: 'Setup Python ${{ matrix.python-version}}'
39+
uses: actions/setup-python@v3
40+
with:
41+
python-version: '${{ matrix.python-version}}'
42+
43+
- name: Install dependencies
44+
run: |
45+
pip install -r requirements.txt
46+
python -m pip install --upgrade pip
47+
48+
- name: Run black formatter
49+
run: black .

0 commit comments

Comments
 (0)