Skip to content

Commit 30df0bd

Browse files
committed
Add GitHub Action for publishing to Docker and Pypi
1 parent 82aa842 commit 30df0bd

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Manual Docker Build and Push
2+
3+
on:
4+
workflow_dispatch: # Allows manual triggering
5+
6+
jobs:
7+
build-and-push:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Log in to Docker Hub
14+
uses: docker/login-action@v3
15+
with:
16+
username: ${{ secrets.DOCKERHUB_USERNAME }}
17+
password: ${{ secrets.DOCKERHUB_TOKEN }}
18+
19+
- name: Build and push Docker image
20+
uses: docker/build-push-action@v5
21+
with:
22+
context: .
23+
push: true
24+
tags: sethblack/python-seo-analyzer:latest # Use your Docker Hub username
25+
26+
publish-to-pypi:
27+
needs: build-and-push # Optional: Make this job depend on the Docker build
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.x' # Use an appropriate Python version
37+
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install build twine
42+
43+
- name: Build package
44+
run: python -m build
45+
46+
- name: Publish package to PyPI
47+
uses: pypa/gh-action-pypi-publish@release/v1
48+
with:
49+
user: __token__
50+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)