From b7e5a80b2151a7bb7c0e8727988c8a43427ba9d2 Mon Sep 17 00:00:00 2001 From: mtoohey31 Date: Wed, 10 Nov 2021 23:43:14 -0500 Subject: [PATCH] ci: add container publishing workflow --- .github/workflows/publish.yaml | 22 ++++++++++++++++++++++ Dockerfile | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..fd4f213 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,22 @@ +name: Publish container +on: + push: + branches: + - master + workflow_dispatch: +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_TOKEN }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Publish container to Docker Hub + run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 --tag "mtoohey/standardnotes-extensions:$(git log -1 --format="%H" | cut -c -6)" --tag mtoohey/standardnotes-extensions:latest --push . diff --git a/Dockerfile b/Dockerfile index 5cd54d8..1085861 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,6 @@ FROM python:3-alpine WORKDIR /build COPY requirements.txt build_repo.py ./ -RUN pip3 install -r requirements.txt +RUN pip3 install --no-cache-dir -r requirements.txt -ENTRYPOINT python3 build_repo.py +ENTRYPOINT ["python3", "build_repo.py"]