Skip to content

Commit

Permalink
ci: Refactor GitHub actions and Makefile targets
Browse files Browse the repository at this point in the history
- Refactored GitHub workflows to separate publishing tasks into 'publish-package' and 'publish-image'
- Reorganized Makefile to include targets for pushing both packages and images
- Updated Docker image for the 'app' service in compose.yaml
  • Loading branch information
johnnyhuy committed Apr 18, 2024
1 parent 8958550 commit bcd3a82
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 12 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Image

on:
workflow_dispatch:
workflow_call:

jobs:
publish:
runs-on: ubuntu-latest

strategy:
matrix:
platform:
- linux/amd64
- linux/arm64

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- run: make publish-image
18 changes: 18 additions & 0 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Package

on:
workflow_dispatch:
workflow_call:

jobs:
publish:
runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v3
- run: make publish-package
14 changes: 4 additions & 10 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ on:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
publish-package:
uses: ./.github/workflows/publish-package.yaml

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v3
- run: make publish
publish-image:
uses: ./.github/workflows/publish-image.yaml
2 changes: 1 addition & 1 deletion .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

jobs:
build:
version:
runs-on: ubuntu-latest

env:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ bump-patch:
gh-bump:
gh workflow run version.yaml

publish: build
publish-package: build
rm -rdf dist
ifdef DRY_RUN
$(VENV) python -m twine upload --repository testpypi dist/*
else
$(VENV) python -m twine upload dist/*
endif

publish-image: build-image
docker compose push

transcribe: install
$(VENV) python transcribe_me/main.py

Expand Down
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3'
services:
app:
image: ghcr.io/echohello-dev/transcribe-me:latest
build: .
volumes:
- ./input:/app/input
Expand Down

0 comments on commit bcd3a82

Please sign in to comment.