Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/pr-auto-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Automatically mark PRs to sync"

on:
pull_request:
types:
- opened

jobs:
labeler:
if: github.event.pull_request.user.type != 'Bot'
permissions:
pull-requests: write

runs-on: ubuntu-latest
steps:
- name: Add "sync" label to PR
run: gh pr edit "$PR_URL" --add-label sync --repo "$PR_REPO"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_REPO: ${{ github.repository }}

- name: Comment on PR to explain sync label
run: gh pr comment "$PR_URL" --body "This pull request has been marked to **automatically sync** to its base branch. You can **disable** this behavior by removing the `sync` label." --repo "$PR_REPO"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_REPO: ${{ github.repository }}
23 changes: 23 additions & 0 deletions .github/workflows/pr-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Automatically enable auto-merge on PRs"

on:
pull_request_target:
types:
- opened
- ready_for_review
branches:
- main

jobs:
enable-automerge:
if: github.event.pull_request.draft == false
permissions:
pull-requests: write

runs-on: ubuntu-latest
steps:
- name: Enable auto-merge for the PR
run: gh pr merge "$PR_URL" --auto --squash
env:
GH_TOKEN: ${{ secrets.PR_AUTO_UPDATE_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
26 changes: 26 additions & 0 deletions .github/workflows/pr-auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pr-auto-update
on:
push: {}

jobs:
pr-auto-update:
name: Automatic PR Updater
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Generate Access Token
uses: actions/create-github-app-token@v2
id: generate-token
with:
app-id: ${{ vars.PR_AUTO_UPDATE_CLIENT_ID }}
private-key: ${{ secrets.PR_AUTO_UPDATE_PRIVATE_KEY }}

- uses: CSSUoB/pr-auto-updater@v2.3.1
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
PR_FILTER: 'labelled'
PR_LABELS: 'sync'
MERGE_CONFLICT_ACTION: 'label'
MERGE_CONFLICT_LABEL: 'conflict'
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM ruby:4.0.1 AS base

RUN bundle config set frozen 'true' && \
bundle config set path '/vendor/bundle'

WORKDIR /usr/src/app

COPY Gemfile Gemfile.lock ./
RUN bundle install

COPY . .

FROM base AS build-step
RUN bundle exec jekyll build

FROM scratch AS build
COPY --from=build-step /usr/src/app/_site /

FROM base AS server
EXPOSE 4000
CMD bundle exec jekyll serve --host 0.0.0.0 --port 4000 --destination /tmp/_site
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.PHONY: all build serve clean

all: build

build: clean
docker buildx build . --target build --output type=local,dest=./_site

serve:
docker compose up --build

clean:
rm -rf _site

fmt:
npm run format:fix

lint:
npm run lint:fix

spellcheck:
npm run spellcheck:staged
9 changes: 9 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
jekyll:
build:
context: .
target: server
volumes:
- "./:/usr/src/app"
ports:
- "4000:4000"