From 39cf37b6c246a582713c6b8a2c276a1f768fbd73 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Mon, 13 Nov 2023 18:07:53 +0800 Subject: [PATCH] Add push container image GitHub Actions --- .github/workflows/container.yml | 22 ++++++++++++++++++++++ Containerfile | 2 +- README.md | 3 +-- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/container.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 00000000..3ca2540f --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,22 @@ +name: Publish container + +on: + workflow_run: + workflows: [test] + types: + - completed + branches: + - master + +jobs: + publish_container: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - run: podman login -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io + - run: podman build -t ghcr.io/${{ github.repository }} . + - run: podman push ghcr.io/${{ github.repository }} diff --git a/Containerfile b/Containerfile index c31caedb..ed3cb207 100644 --- a/Containerfile +++ b/Containerfile @@ -4,4 +4,4 @@ COPY pyproject.toml README.md LICENSE . COPY src src RUN python -m pip install -U pip RUN python -m pip install --use-pep517 . -ENTRYPOINT bash +ENTRYPOINT ["wiktwords"] diff --git a/README.md b/README.md index 2ca2d92e..b4aff931 100644 --- a/README.md +++ b/README.md @@ -304,8 +304,7 @@ word `thrill` as an English verb (only one part-of-speech is shown here): #### Use container: ``` -$ podman build -t wiktextract . -$ podman run -it --rm wiktextract wiktwords --help +$ podman run -it --rm ghcr.io/tatuylonen/wiktextract --help ``` #### Install from source: