Add Dockerfile and gitea workflow
This commit is contained in:
parent
c6fc0b093b
commit
cc57dee334
42
.gitea/workflows/build-image.yaml
Normal file
42
.gitea/workflows/build-image.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
name: Build OCI Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
# list of Docker images to use as base name for tags
|
||||||
|
images: |
|
||||||
|
harbor.yadunut.dev/yadunut/yadunut.dev
|
||||||
|
# generate Docker tags based on the following events/attributes
|
||||||
|
tags: |
|
||||||
|
type=sha,suffix=-{{ commit_date 'X' }}
|
||||||
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
|
||||||
|
- name: Login to Harbor
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: harbor.yadunut.dev
|
||||||
|
username: ${{ secrets.HARBOR_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_PASSWORD }}
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
18
.gitignore
vendored
Normal file
18
.gitignore
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
|
!flake.lock
|
||||||
|
!flake.nix
|
||||||
|
!zine.ziggy
|
||||||
|
!Dockerfile
|
||||||
|
!layouts/
|
||||||
|
!layouts/**
|
||||||
|
|
||||||
|
!content/
|
||||||
|
!content/**
|
||||||
|
|
||||||
|
!assets/
|
||||||
|
!assets/**
|
||||||
|
|
||||||
|
!.gitea/
|
||||||
|
!.gitea/workflows/
|
||||||
|
!.gitea/workflows/**
|
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
FROM alpine:3.22.1 as zine
|
||||||
|
ARG ZINE_VERSION=v0.11.1
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN apk add --no-cache curl tar xz \
|
||||||
|
&& case "$TARGETARCH" in \
|
||||||
|
amd64) Z_ARCH="x86_64-linux-musl";; \
|
||||||
|
arm64) Z_ARCH="aarch64-linux-musl";; \
|
||||||
|
*) echo "Unsupported TARGETARCH: $TARGETARCH" && exit 1;; \
|
||||||
|
esac \
|
||||||
|
&& curl -L "https://github.com/kristoff-it/zine/releases/download/${ZINE_VERSION}/${Z_ARCH}.tar.xz" -o /tmp/zine.tar.xz \
|
||||||
|
&& tar -C /usr/local/bin -xJf /tmp/zine.tar.xz zine \
|
||||||
|
&& chmod +x /usr/local/bin/zine \
|
||||||
|
&& zine --version
|
||||||
|
|
||||||
|
FROM alpine:3.22.1 as builder
|
||||||
|
COPY --from=zine /usr/local/bin/zine /usr/local/bin/zine
|
||||||
|
WORKDIR /site
|
||||||
|
COPY . .
|
||||||
|
RUN zine release
|
||||||
|
|
||||||
|
FROM nginx:alpine3.22 AS runner
|
||||||
|
COPY --from=builder /site/public/ /usr/share/nginx/html/
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
Loading…
Reference in New Issue
Block a user