From 8d51b5e7e4131dd719f64494960aaf3e52bb1957 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 6 Nov 2024 23:55:41 +0000 Subject: [PATCH] chore: Add release-drafter github action. --- .github/workflows/ci.yml | 3 +++ .github/workflows/release.yml | 12 +++++++++ .ruby-version | 1 + Dockerfile | 48 +++++++++++++++-------------------- 4 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .ruby-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c615e6..f7aeea8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ on: branches: [master] jobs: + common: + uses: TokTok/ci-tools/.github/workflows/common-ci.yml@master + docker: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9f4ee30 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,12 @@ +name: release + +on: + push: + branches: [master] + pull_request_target: + branches: [master] + types: [opened, reopened, synchronize] + +jobs: + release: + uses: TokTok/ci-tools/.github/workflows/release-drafter.yml@master diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..50e47c8 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.1.1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index af363e7..8b58b1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,25 @@ -FROM ubuntu:20.04 - -ENV DEBIAN_FRONTEND="noninteractive" - -# hadolint ignore=DL3008 -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - curl \ - git \ - graphviz \ - make \ - pandoc \ - python3 \ - python3-bs4 \ - python3-pip \ - python3-requests \ - python3-urllib3 \ - python3-xdg \ - ruby \ - ruby-dev \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* +FROM alpine:3.20.0 + +# hadolint ignore=DL3018 +RUN ["apk", "add", "--no-cache", \ + "curl", \ + "g++", \ + "gcc", \ + "git", \ + "graphviz", \ + "jekyll", \ + "make", \ + "pandoc", \ + "py3-pip", \ + "python3"] +RUN python3 -m venv /path/to/venv # hadolint ignore=DL3013 -RUN pip install --no-cache-dir LinkChecker +RUN . /path/to/venv/bin/activate \ + && pip install --no-cache-dir LinkChecker -RUN ["gem", "install", "--no-document", "jekyll:4.2.2", "guard-livereload", "mdl"] +RUN ["gem", "install", "--no-document", "guard-livereload", "mdl"] -RUN groupadd -r -g 1000 builder \ - && useradd --no-log-init -r -g builder -u 1000 builder +RUN addgroup -S builder && adduser -SDH -G builder builder WORKDIR /home/builder/build COPY toktok /home/builder/build/toktok/ @@ -41,7 +34,8 @@ RUN ["make", "toktok-site"] COPY .md-style.rb /home/builder/build/ RUN ["make", "lint"] -RUN ["make", "check"] +RUN . /path/to/venv/bin/activate \ + && make check WORKDIR /home/builder/build/toktok-site ENTRYPOINT ["/home/builder/entrypoint.sh"]