Skip to content

Commit d74307a

Browse files
committed
added some workflows
1 parent da66569 commit d74307a

File tree

9 files changed

+290
-0
lines changed

9 files changed

+290
-0
lines changed

.github/auto-merge.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- match:
2+
dependency_type: development
3+
update_type: semver:minor
4+
- match:
5+
dependency_type: production
6+
update_type: semver:minor
7+
- match:
8+
dependency_type: production
9+
update_type: semver:patch

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
commit-message:
6+
prefix: build
7+
prefix-development: chore
8+
include: scope
9+
schedule:
10+
interval: daily

.github/release-drafter.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name-template: "v$NEXT_PATCH_VERSION"
2+
tag-template: "v$NEXT_PATCH_VERSION"
3+
template: |
4+
# What's Changed
5+
6+
$CHANGES
7+
categories:
8+
- title: "New Features"
9+
labels:
10+
- "Feature"
11+
- "Feature :boom:"
12+
- title: "Improvements"
13+
labels:
14+
- "enhancement"
15+
- "Improvement"
16+
- "Enhancement :tada:"
17+
- "Improvement :tada:"
18+
- title: "Bug Fixes"
19+
labels:
20+
- "bug"
21+
- "bug :bug:"
22+
- "Bug fix"
23+
- "Bug fix :bug:"
24+
- "Bug Fix"
25+
- "Bug Fix :bug:"
26+
- "Bug Fixes"
27+
- "Bug Fixes :bug:"
28+
- title: "Breaking Changes"
29+
labels:
30+
- "BC Break"
31+
- "BC Break :fire:"
32+
- title: "Environment Variable Changes"
33+
labels:
34+
- "Env"
35+
- "Env :man_technologist:"
36+
- "env"
37+
- "env :man_technologist:"
38+
- "Env change"
39+
- "Env change :man_technologist:"
40+
- "Env Change"
41+
- "Env Change :man_technologist:"
42+
- title: "External Change"
43+
labels:
44+
- "external"
45+
- "external :shipit:"
46+
- title: "Dependencies"
47+
labels:
48+
- "dependencies"
49+
- "dependencies :electric_plug:"
50+
51+
version-resolver:
52+
major:
53+
labels:
54+
- "type: breaking"
55+
minor:
56+
labels:
57+
- "type: feature"
58+
patch:
59+
labels:
60+
- "type: bug"
61+
- "type: maintenance"
62+
- "type: docs"
63+
- "type: dependencies"
64+
- "type: security"
65+
66+
exclude-labels:
67+
- "skip-changelog"

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
environment: production
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 1
16+
- name: Extract tag
17+
id: extract_tag
18+
run: echo "{tag}=${GITHUB_REF/refs\\/tags\\//}" >> $GITHUB_OUTPUT
19+
- name: Meta
20+
id: meta
21+
uses: docker/metadata-action@v5
22+
with:
23+
images: containers.chewed-k8s.net/flags-gg/docs
24+
tags: |
25+
type=semver,pattern={{version}}
26+
type=semver,pattern={{raw}}
27+
type=sha
28+
- name: QEMU
29+
id: qemu
30+
uses: docker/setup-qemu-action@v3
31+
- name: Buildx
32+
id: buildx
33+
uses: docker/setup-buildx-action@v3
34+
- name: Cache
35+
uses: actions/cache@v3
36+
with:
37+
path: /tmp/.buildx-cache
38+
key: ${{ runner.os }}-buildx-${{ github.sha }}
39+
restore-keys: ${{ runner.os }}-buildx-
40+
- name: Login Github
41+
uses: docker/login-action@v3
42+
with:
43+
registry: containers.chewed-k8s.net
44+
username: robot$flags-gg+github
45+
password: ${{ secrets.CONTAINERS_KEY }}
46+
- name: Build and Push
47+
id: docker_build
48+
uses: docker/build-push-action@v5
49+
with:
50+
context: .
51+
platforms: linux/amd64, linux/arm64
52+
builder: ${{ steps.buildx.outputs.name }}
53+
file: ./k8s/Containerfile
54+
tags: ${{ steps.meta.outputs.tags }}
55+
labels: ${{ steps.meta.outputs.labels }}
56+
push: true

.github/workflows/drafter.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Drafter
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
update_release_draft:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
steps:
17+
- uses: release-drafter/release-drafter@v6
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pulls.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pull Requests
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
11+
jobs:
12+
automerge:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: write
16+
contents: write
17+
steps:
18+
- uses: fastify/github-action-merge-dependabot@v3
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}

Caddyfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:80 {
2+
root * /srv
3+
file_server
4+
}

k8s/Containerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#Builder
2+
FROM containers.chewed-k8s.net/docker_hub_cache/library/golang:alpine3.19 AS builder
3+
WORKDIR /builder
4+
5+
RUN apk update && apk add --no-cache git
6+
RUN mkdir /src && cd /src
7+
RUN git clone https://github.com/gohugoio/hugo.git .
8+
RUN git checkout v0.139.4
9+
RUN go install
10+
11+
RUN cd /builder
12+
COPY . .
13+
14+
RUN hugo
15+
16+
## Runner
17+
FROM caddy AS runner
18+
19+
COPY --from=builder /builder/public /srv
20+
COPY ./Caddyfile /etc/caddy/Caddyfile
21+
22+
EXPOSE 80
23+
EXPOSE 443

k8s/service.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
namespace: flags-gg
6+
name: docs
7+
labels:
8+
name: docs
9+
app: docs
10+
spec:
11+
replicas: 2
12+
revisionHistoryLimit: 2
13+
strategy:
14+
rollingUpdate:
15+
maxUnavailable: 1
16+
maxSurge: 3
17+
selector:
18+
matchLabels:
19+
app: docs
20+
name: docs
21+
template:
22+
metadata:
23+
labels:
24+
app: docs
25+
name: docs
26+
spec:
27+
containers:
28+
- name: docs
29+
image: containers.chewed-k8s.net/flags-gg/docs:latest
30+
imagePullPolicy: always
31+
ports:
32+
- containerPort: 80
33+
protocol: TCP
34+
imagePullSecrets:
35+
- name: docker-registry-secret
36+
37+
---
38+
apiVersion: v1
39+
kind: Service
40+
metadata:
41+
name: docs
42+
namespace: flags-gg
43+
labels:
44+
app: docs
45+
spec:
46+
ports:
47+
- port: 80
48+
protocol: TCP
49+
targetPort: 80
50+
selector:
51+
app: docs
52+
53+
---
54+
apiVersion: networking.k8s.io/v1
55+
kind: Ingress
56+
metadata:
57+
name: docs
58+
namespace: flags-gg
59+
annotations:
60+
cert-manager.io/cluster-issuer: live-issuer
61+
nginx.ingress.kubernetes.io/rewrite-target: /
62+
labels:
63+
name: docs
64+
app: docs
65+
spec:
66+
ingressClassName: nginx
67+
tls:
68+
- hosts:
69+
- docs.flags.gg
70+
secretName: docs-tls
71+
rules:
72+
- host: docs.flags.gg
73+
http:
74+
paths:
75+
- path: /
76+
pathType: Prefix
77+
backend:
78+
service:
79+
name: docs
80+
port:
81+
number: 80
82+

0 commit comments

Comments
 (0)