From 003204afb137fe7c0678b20a47b68ab4b96bca14 Mon Sep 17 00:00:00 2001 From: Firq Date: Mon, 22 Jul 2024 17:40:57 +0200 Subject: [PATCH] Add docker build step to provide ready-to-use dockge cli container --- .forgejo/workflows/build-release.yaml | 35 +++++++++++++++++++++++++++ Dockerfile | 4 +++ 2 files changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/.forgejo/workflows/build-release.yaml b/.forgejo/workflows/build-release.yaml index 600b9b0..9bbcfd2 100644 --- a/.forgejo/workflows/build-release.yaml +++ b/.forgejo/workflows/build-release.yaml @@ -56,3 +56,38 @@ jobs: run: pip install twine - name: Upload package to registry run: python -m twine upload --repository-url ${{ secrets.REPOSITORY_URL }} -u ${{ secrets.TWINE_DEPLOY_USER }} -p ${{ secrets.TWINE_DEPLOY_PASSWORD }} dist/* + + build-and-push-container: + needs: [ "publish-artifacts" ] + runs-on: dind + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log into Docker Package Registry + uses: docker/login-action@v3 + with: + registry: forgejo.neshweb.net + username: ${{ secrets.FORGEJO_USERNAME }} + password: ${{ secrets.FORGEJO_TOKEN }} + - name: Build and push to Docker Package Registry + uses: docker/build-push-action@v5 + with: + context: . + build-args: | + PACKAGE_VERSION=${{ github.ref_name }} + push: true + tags: forgejo.neshweb.net/firq/dockge-cli:${{ github.ref_name }} + + release: + needs: [ build-and-push-container, publish-artifacts ] + if: success() + runs-on: docker + steps: + - name: Release New Version + uses: actions/forgejo-release@v1 + with: + direction: upload + url: https://forgejo.neshweb.net + release-dir: release + token: ${{ secrets.FORGEJO_TOKEN }} + tag: ${{ github.ref_name }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..88e754d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM forgejo.neshweb.net/ci-docker-images/python-neshweb:3.11 + +ARG PACKAGE_VERSION=0.1.0 +RUN pip install dockge-cli==${PACKAGE_VERSION}