Skip to content

Commit d74af7e

Browse files
authored
Updates (#1)
1 parent 4159374 commit d74af7e

18 files changed

+524
-105
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ko_fi: cssnr

.github/workflows/build.yaml

Lines changed: 72 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: "Build"
22

33
on:
44
workflow_dispatch:
@@ -9,42 +9,95 @@ on:
99
release:
1010
types: [published]
1111

12-
env:
13-
REGISTRY: "ghcr.io"
14-
1512
jobs:
1613
build:
1714
name: "Build"
1815
runs-on: ubuntu-latest
19-
timeout-minutes: 25
16+
timeout-minutes: 15
17+
18+
permissions:
19+
contents: write
20+
packages: write
2021

2122
steps:
2223
- name: "Checkout"
23-
uses: actions/checkout@v4
24+
uses: actions/checkout@v5
2425

25-
- name: "Setup Buildx"
26-
uses: docker/setup-buildx-action@v2
27-
with:
28-
platforms: linux/amd64,linux/arm64
26+
- name: "Debug CTX github"
27+
if: ${{ !github.event.act }}
28+
continue-on-error: true
29+
env:
30+
GITHUB_CTX: ${{ toJSON(github) }}
31+
run: echo "$GITHUB_CTX"
2932

3033
- name: "Docker Login"
31-
uses: docker/login-action@v2
34+
uses: docker/login-action@v3
3235
with:
33-
registry: ${{ env.REGISTRY }}
36+
registry: ghcr.io
3437
username: ${{ vars.GHCR_USER }}
3538
password: ${{ secrets.GHCR_PASS }}
3639

37-
- name: "Generate Tags"
40+
- name: "Setup Buildx"
41+
uses: docker/setup-buildx-action@v3
42+
with:
43+
platforms: linux/amd64,linux/arm64
44+
45+
- name: "Generate Version Tags"
46+
id: version
47+
uses: cssnr/update-version-tags-action@v1
48+
with:
49+
prefix: ""
50+
release: true
51+
tags: ${{ inputs.tags }}
52+
53+
- name: "Debug Version Tags"
54+
continue-on-error: true
55+
run: |
56+
echo "github.ref_name: ${{ github.ref_name }}"
57+
echo "inputs.tags: ${{ inputs.tags }}"
58+
echo "steps.version.outputs.tags: ${{ steps.version.outputs.tags }}"
59+
60+
- name: "Generate Docker Tags"
3861
id: tags
39-
uses: smashedr/docker-tags-action@master
62+
uses: cssnr/docker-tags-action@v1
4063
with:
41-
images: "${{ env.REGISTRY }}/${{ github.repository }}"
42-
extra: ${{ inputs.tags }}
64+
images: "ghcr.io/${{ github.repository }}"
65+
tags: ${{ steps.version.outputs.tags }}
66+
67+
- name: "Debug Docker Tags"
68+
continue-on-error: true
69+
run: |
70+
echo "github.ref_name: ${{ github.ref_name }}"
71+
echo "tags: ${{ steps.tags.outputs.tags }}"
72+
echo "labels: ${{ steps.tags.outputs.labels }}"
73+
echo "annotations: ${{ steps.tags.outputs.annotations }}"
74+
75+
#- name: "Parse Nginx Version"
76+
# uses: madhead/semver-utils@latest
77+
# id: semver
78+
# with:
79+
# version: ${{ github.ref_name }}
80+
81+
#- name: "Debug Nginx Version"
82+
# continue-on-error: true
83+
# run: |
84+
# echo "NGINX_VERSION: ${{ steps.semver.outputs.release }}"
4385

4486
- name: "Build and Push"
45-
uses: docker/build-push-action@v4
87+
uses: docker/build-push-action@v6
4688
with:
47-
context: nginx
48-
platforms: linux/amd64,linux/arm64
89+
context: src
4990
push: true
91+
platforms: linux/amd64,linux/arm64
5092
tags: ${{ steps.tags.outputs.tags }}
93+
labels: ${{ steps.tags.outputs.labels }}
94+
annotations: ${{ steps.tags.outputs.annotations }}
95+
#build-args: |
96+
# VERSION=${{ github.ref_name }}
97+
# NGINX_VERSION=${{ steps.semver.outputs.release }}
98+
99+
- name: "Send Failure Notification"
100+
if: ${{ failure() }}
101+
uses: sarisia/actions-status-discord@v1
102+
with:
103+
webhook: ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/labeler.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "PR Labeler"
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
labeler:
8+
name: "Labeler"
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 5
11+
12+
permissions:
13+
pull-requests: write
14+
issues: write
15+
16+
steps:
17+
- name: "Checkout Configs"
18+
uses: actions/checkout@v5
19+
with:
20+
repository: cssnr/configs
21+
ref: master
22+
path: .configs
23+
sparse-checkout-cone-mode: false
24+
sparse-checkout: |
25+
labels/**
26+
27+
- name: "Debug"
28+
continue-on-error: true
29+
run: |
30+
echo "::group::labels.yaml"
31+
cat .configs/labels/labels.yaml
32+
echo "::endgroup::"
33+
34+
echo "::group::labeler.yaml"
35+
cat .configs/labels/labeler.yaml
36+
echo "::endgroup::"
37+
38+
- name: "Label Creator"
39+
continue-on-error: true
40+
uses: cssnr/label-creator-action@v1
41+
with:
42+
file: .configs/labels/labels.yaml
43+
44+
- name: "Labeler"
45+
uses: actions/labeler@v6
46+
with:
47+
sync-labels: true
48+
configuration-path: .configs/labels/labeler.yaml

.github/workflows/lint.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: "Lint"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
name: "Lint"
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
19+
permissions:
20+
pull-requests: write
21+
22+
steps:
23+
- name: "Checkout"
24+
uses: actions/checkout@v5
25+
26+
- name: "Setup Node 24"
27+
uses: actions/setup-node@v6
28+
with:
29+
node-version: 24
30+
31+
- name: "Prettier"
32+
if: ${{ !cancelled() }}
33+
run: |
34+
echo "::group::Install"
35+
npm install prettier
36+
echo "::endgroup::"
37+
npx prettier --check .
38+
39+
- name: "Yamllint"
40+
if: ${{ !cancelled() }}
41+
env:
42+
CONFIG: "{extends: relaxed, ignore: [node_modules/], rules: {line-length: {max: 119}}}"
43+
run: |
44+
echo "::group::List Files"
45+
yamllint -d '${{ env.CONFIG }}' --list-files .
46+
echo "::endgroup::"
47+
yamllint -d '${{ env.CONFIG }}' .
48+
49+
- name: "Actionlint"
50+
if: ${{ !cancelled() }}
51+
run: |
52+
echo "::group::Download"
53+
loc=$(curl -sI https://github.com/rhysd/actionlint/releases/latest | grep -i '^location:')
54+
echo "loc: ${loc}"
55+
tag=$(echo "${loc}" | sed -E 's|.*/tag/v?(.*)|\1|' | tr -d '\t\r\n')
56+
echo "tag: ${tag}"
57+
url="https://github.com/rhysd/actionlint/releases/latest/download/actionlint_${tag}_linux_amd64.tar.gz"
58+
echo "url: ${url}"
59+
curl -sL "${url}" | tar xz -C "${RUNNER_TEMP}" actionlint
60+
file "${RUNNER_TEMP}/actionlint"
61+
"${RUNNER_TEMP}/actionlint" --version
62+
echo "::endgroup::"
63+
"${RUNNER_TEMP}/actionlint" -color -verbose -shellcheck= -pyflakes=
64+
65+
- name: "Hadolint"
66+
if: ${{ !cancelled() }}
67+
uses: hadolint/[email protected]
68+
with:
69+
dockerfile: src/Dockerfile
70+
ignore: "DL3018"

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Release"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: "Release"
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
13+
permissions:
14+
contents: write
15+
16+
steps:
17+
- name: "Update Release Notes Action"
18+
continue-on-error: true
19+
uses: smashedr/update-release-notes-action@master
20+
with:
21+
location: tail
22+
23+
- name: "Send Failure Notification"
24+
if: ${{ failure() }}
25+
uses: sarisia/actions-status-discord@v1
26+
with:
27+
webhook: ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/tags.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
.idea/
22
*.iml
33
.vscode/
4+
node_modules/
5+
eslint_report.json
6+
.env
7+
.secrets
8+
.vars

.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# IDE
2+
.idea/
3+
.vscode/
4+
5+
# Tools
6+
.ruff_cache/
7+
.mypy_cache/
8+
.pytest_cache/
9+
eslint_report.json
10+
11+
# Build
12+
dist/
13+
node_modules/
14+
.github/disabled/
15+
16+
# Files
17+
.github/pull_request_template.md

.prettierrc.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{
22
"trailingComma": "es5",
3-
"tabWidth": 4,
43
"semi": false,
54
"singleQuote": true,
65
"overrides": [
76
{
8-
"files": ["**/*.json", "**/*.yaml", "**/*.yml"],
7+
"files": ["**/*.html", "**/*.yaml", "**/*.yml"],
98
"options": {
109
"singleQuote": false
1110
}
1211
},
1312
{
14-
"files": ["**/*.json", "**/*.yaml", "**/*.yml"],
13+
"files": ["**/*.js", "**/*.mjs", "**/*.css", "**/*.scss"],
1514
"options": {
16-
"tabWidth": 2
15+
"tabWidth": 4
1716
}
1817
}
1918
]

0 commit comments

Comments
 (0)