Skip to content

Commit f50aa52

Browse files
committed
ci: Refactor CI workflows and Makefile targetingressive use of docker buildx.
- Update Makefile to conditionally use `docker buildx` for `publish-image` target - Update release.yaml workflow to add new outputs and create a `publish` job for deployment
1 parent 05ff513 commit f50aa52

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

.github/workflows/release.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ jobs:
1313
release:
1414
runs-on: ubuntu-latest
1515

16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
16+
outputs:
17+
tag_name: ${{ steps.drafter.outputs.tag_name }}
1918

2019
steps:
21-
- uses: actions/checkout@v4
22-
- uses: asdf-vm/actions/install@v3
2320
- uses: release-drafter/release-drafter@v5
2421
id: drafter
2522
with:
2623
version: ${{ github.ref_name }}
2724
publish: true
25+
26+
publish:
27+
runs-on: ubuntu-latest
28+
needs: release
29+
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: asdf-vm/actions/install@v3
2837
- run: make publish
2938
env:
30-
VERSION: ${{ steps.drafter.outputs.tag_name }}
39+
VERSION: ${{ needs.release.outputs.tag_name }}

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,17 @@ else
6464
endif
6565

6666
publish-image: login-ghcr
67+
ifdef CI
68+
docker buildx build \
69+
-t ghcr.io/echohello-dev/transcribe-me:latest \
70+
-t ghcr.io/echohello-dev/transcribe-me:$(VERSION) \
71+
--cache-from=type=gha,scope=image \
72+
--cache-to=type=gha,mode=max \
73+
--platform $(DOCKER_DEFAULT_PLATFORM) \
74+
--push .
75+
else
6776
docker compose build --push
77+
endif
6878

6979
transcribe: install
7080
$(VENV) python -m transcribe_me.main

0 commit comments

Comments
 (0)