Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker build #32

Merged
merged 4 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build Docker image

on:
workflow_dispatch:
pull_request:
push:
tags:
- "v**"
Expand Down Expand Up @@ -37,7 +38,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: | # almost same as action default
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag,pattern={{raw}}
# type=ref,event=workflow_dispatch
type=sha,event=workflow_dispatch
Expand All @@ -49,7 +50,7 @@ jobs:
uses: docker/[email protected]
with:
context: .
push: true
push: ${{ github.event_name != 'pull_request' }}
build-args:
MOEFLOW_BUILD_ID=${{ github.repository }}:${{ github.ref }}:${{ github.sha }}
cache-from:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ WORKDIR /app

EXPOSE 5000

RUN make babel-update-mo
RUN BIN_PREFIX=/usr/local/bin make babel-update-mo
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
PYTEST_COV_ARGS =

BIN_PREFIX ?= venv/bin

FORCE: ;

create-venv:
Expand Down Expand Up @@ -44,11 +46,11 @@ test_logging:
venv/bin/pytest --capture=sys --log-cli-level=DEBUG tests/base/test_logging.py

babel-update-po:
venv/bin/pybabel extract -F babel.cfg -k lazy_gettext -k hardcode_text -o messages.pot app
venv/bin/pybabel update -i messages.pot -d app/translations
$(BIN_PREFIX)/pybabel extract -F babel.cfg -k lazy_gettext -k hardcode_text -o messages.pot app
$(BIN_PREFIX)/pybabel update -i messages.pot -d app/translations

babel-update-mo: babel-update-po
venv/bin/pybabel compile -d app/translations
$(BIN_PREFIX)/pybabel compile -d app/translations

babel-translate-po:
venv/bin/python app/scripts/fill_zh_translations.py
Expand Down
Loading