From 881a894e8d9ead07484de87484da00e6aa7e0658 Mon Sep 17 00:00:00 2001 From: Firq Date: Thu, 21 Dec 2023 12:12:35 +0100 Subject: [PATCH] first version of unlighthouse docker --- .forgejo/workflows/build_release.yml | 36 ++++++++++++++++++++++++++++ Dockerfile | 12 ++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .forgejo/workflows/build_release.yml create mode 100644 Dockerfile diff --git a/.forgejo/workflows/build_release.yml b/.forgejo/workflows/build_release.yml new file mode 100644 index 0000000..10a3b64 --- /dev/null +++ b/.forgejo/workflows/build_release.yml @@ -0,0 +1,36 @@ +on: + push: + tags: + - '[0-9]+\.[0-9]+\.[0-9]+' + +jobs: + build: + runs-on: dind + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: forgejo.neshweb.net + username: ${{ secrets.FORGEJO_USERNAME }} + password: ${{ secrets.FORGEJO_TOKEN }} + - name: Push to Package Registry + uses: docker/build-push-action@v5 + with: + push: true + tags: forgejo.neshweb.net/firq/unlighthouse-docker:${{ github.ref_name }}, forgejo.neshweb.net/firq/unlighthouse-docker:latest + + release: + needs: [build] + 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 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6475c9f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20.10.0-bookworm +WORKDIR /unlighthouse + +# renovate: datasource=repology depName=debian_12/chromium versioning=loose +ENV CHROMIUM_VERSION="120.0.6099.109-1~deb12u1" +ENV NODE_ENV='production' + +# Update path so executable can be run globally +ENV PATH="/unlighthouse/node_modules/.bin:${PATH}" + +RUN apt-get update && apt-get -y install --no-install-recommends chromium=${CHROMIUM_VERSION} procps && rm -rf /var/lib/apt/lists/* +RUN npm install @unlighthouse/cli puppeteer