Skip to content

Commit

Permalink
Merge branch 'master' into feat/pdf-archiver
Browse files Browse the repository at this point in the history
  • Loading branch information
fmartingr authored Dec 8, 2024
2 parents 041526f + 617f5dd commit ddbac3c
Show file tree
Hide file tree
Showing 50 changed files with 543 additions and 242 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/_buildx.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
name: "Build Docker"

on: workflow_call
on:
workflow_call:
inputs:
tag_prefix:
description: 'The tag prefix to use'
required: false
type: string
default: ''
dockerfile:
description: 'The Dockerfile to use'
required: false
type: string
default: 'Dockerfile'

jobs:
buildx:
runs-on: ubuntu-latest
Expand All @@ -22,7 +35,7 @@ jobs:
run: |
REPO=ghcr.io/${{ github.repository }}
TAG=$(git describe --tags)
echo "tag_flags=--tag $REPO:$TAG" >> $GITHUB_ENV
echo "tag_flags=--tag $REPO:${{ inputs.tag_prefix }}$TAG" >> $GITHUB_ENV
# New tagged version
- name: Prepare version push tags
Expand All @@ -36,18 +49,18 @@ jobs:
else
TAG2="latest"
fi
echo "tag_flags=--tag $REPO:$TAG --tag $REPO:$TAG2" >> $GITHUB_ENV
echo "tag_flags=--tag $REPO:${{ inputs.tag_prefix }}$TAG --tag $REPO:${{ inputs.tag_prefix }}$TAG2" >> $GITHUB_ENV
# Every pull request
- name: Prepare pull request tags
if: github.event_name == 'pull_request'
run: |
echo "tag_flags=--tag ${{ github.ref }}" >> $GITHUB_ENV
REPO=ghcr.io/${{ github.repository }}
echo "tag_flags=--tag $REPO:pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "tag_flags=--tag $REPO:${{ inputs.tag_prefix }}pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Buildx
run: |
set -x
echo "${{ secrets.GITHUB_TOKEN }}" | docker login -u "${{ github.repository_owner }}" --password-stdin ghcr.io
make buildx CONTAINER_BUILDX_OPTIONS="--push ${{ env.tag_flags }}"
make buildx CONTAINERFILE_NAME=${{ inputs.dockerfile }} CONTAINER_BUILDX_OPTIONS="--push ${{ env.tag_flags }}"
2 changes: 1 addition & 1 deletion .github/workflows/_gorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # 6.0.0
with:
distribution: goreleaser
version: latest
version: v2.4.8
args: release --clean ${{ env.flags }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/_mkdocs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Check mkdocs documentation"

on: workflow_call

jobs:
mkdocs-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0

- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0

- name: check
run: make docs
env:
MKDOCS_EXTRA_FLAGS: --strict
19 changes: 19 additions & 0 deletions .github/workflows/_mkdocs-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Publish documentation"

on: workflow_call

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0

- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0

- run: make docs
env:
DOCS_COMMAND: publish
12 changes: 11 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN}}
call-swagger-check:
uses: ./.github/workflows/_swagger-check.yml
call-mkdocs-check:
uses: ./.github/workflows/_mkdocs-check.yml
call-styles-check:
uses: ./.github/workflows/_styles-check.yml
call-e2e:
needs: [call-lint, call-test, call-swagger-check, call-styles-check]
needs: [call-lint, call-test, call-swagger-check, call-styles-check, call-mkdocs-check]
uses: ./.github/workflows/_e2e.yml
call-gorelease:
needs: [call-e2e]
Expand All @@ -31,3 +33,11 @@ jobs:
# only build on pull requests from the same repo for now
if: github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/_buildx.yml
call-buildx-alpine:
needs: call-gorelease
# only build on pull requests from the same repo for now
if: github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/_buildx.yml
with:
tag_prefix: alpine-
dockerfile: Dockerfile.alpine
8 changes: 8 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ jobs:
call-buildx:
needs: call-gorelease
uses: ./.github/workflows/_buildx.yml
call-buildx-alpine:
needs: call-gorelease
# only build on pull requests from the same repo for now
if: github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/_buildx.yml
with:
tag_prefix: alpine-
dockerfile: Dockerfile.alpine
11 changes: 11 additions & 0 deletions .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ jobs:
call-buildx:
needs: call-gorelease
uses: ./.github/workflows/_buildx.yml
call-buildx-alpine:
needs: call-gorelease
# only build on pull requests from the same repo for now
if: github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/_buildx.yml
with:
tag_prefix: alpine-
dockerfile: Dockerfile.alpine
call-mkdocs-publish:
needs: [call-buildx, call-buildx-alpine]
uses: ./.github/workflows/_mkdocs-publish.yml
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ go.work*

# workaround for buildx using podman
type=docker

# Docs
docs/.venv
build/docs
4 changes: 3 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -55,7 +57,7 @@ checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Build stage
ARG ALPINE_VERSION
ARG GOLANG_VERSION
ARG ALPINE_VERSION=3.19

FROM docker.io/library/alpine:${ALPINE_VERSION} AS builder
ARG TARGETARCH
Expand All @@ -14,7 +13,7 @@ RUN apk add --no-cache ca-certificates tzdata && \
# Server image
FROM scratch

ENV PORT 8080
ENV PORT=8080
ENV SHIORI_DIR=/shiori
WORKDIR ${SHIORI_DIR}

Expand Down
23 changes: 23 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG ALPINE_VERSION=3.19

FROM docker.io/library/alpine:${ALPINE_VERSION}
ARG TARGETARCH
ARG TARGETOS
ARG TARGETVARIANT
COPY dist/shiori_${TARGETOS}_${TARGETARCH}${TARGETVARIANT}/shiori /usr/bin/shiori
RUN apk add --no-cache ca-certificates tzdata && \
chmod +x /usr/bin/shiori && \
rm -rf /tmp/* && \
apk cache clean

ENV PORT=8080
ENV SHIORI_DIR=/shiori
WORKDIR ${SHIORI_DIR}

LABEL org.opencontainers.image.source="https://github.com/go-shiori/shiori"
LABEL maintainer="Felipe Martin <[email protected]>"

EXPOSE ${PORT}

ENTRYPOINT ["/usr/bin/shiori"]
CMD ["server"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Shiori is distributed under the terms of the [MIT license][mit], which means you
[documentation]: https://github.com/go-shiori/shiori/blob/master/docs/index.md
[mit]: https://choosealicense.com/licenses/mit/
[web-extension]: https://github.com/go-shiori/shiori-web-ext
[screenshot]: https://raw.githubusercontent.com/go-shiori/shiori/master/docs/readme/cover.png
[mode-comparison]: https://raw.githubusercontent.com/go-shiori/shiori/master/docs/readme/comparison.png
[screenshot]: https://raw.githubusercontent.com/go-shiori/shiori/master/docs/assets/screenshots/cover.png
[mode-comparison]: https://raw.githubusercontent.com/go-shiori/shiori/master/docs/assets/screenshots/comparison.png
[pocket]: https://getpocket.com/
[256]: https://github.com/go-shiori/shiori/issues/256
14 changes: 14 additions & 0 deletions docs/Contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,17 @@ Finally, run the tests with the following command:
```bash
make unittest
```

## Building the documentation

The documentation is built using MkDocs with the Material theme. For installation instructions, please refer to the [MkDocs installation guide](https://www.mkdocs.org/user-guide/installation/).

To preview the documentation locally while making changes, run:

```bash
mkdocs serve
```

This will start a local server at `http://127.0.0.1:8000` where you can preview your changes in real-time.

Documentation for production is generated automatically on every release and published using github pages.
Loading

0 comments on commit ddbac3c

Please sign in to comment.