Compare commits
4 Commits
5bb488ccd0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 937f014ce0 | |||
| e6ff59c75b | |||
| 79a4bcb890 | |||
| 62f1ea5d36 |
@@ -0,0 +1,87 @@
|
|||||||
|
name: Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: fsadmin/md-to-html
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Prepare tags
|
||||||
|
id: meta
|
||||||
|
shell: sh
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if [ -z "${{ vars.REGISTRY }}" ]; then
|
||||||
|
echo "::error::Set the REGISTRY repository variable to your Gitea registry host."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
image="${{ vars.REGISTRY }}/${IMAGE_NAME}"
|
||||||
|
short_sha="$(printf '%s' "${GITHUB_SHA}" | cut -c1-12)"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "image=${image}"
|
||||||
|
echo "tags<<EOF"
|
||||||
|
echo "${image}:${short_sha}"
|
||||||
|
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
|
||||||
|
echo "${image}:latest"
|
||||||
|
fi
|
||||||
|
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
|
||||||
|
echo "${image}:${GITHUB_REF_NAME}"
|
||||||
|
fi
|
||||||
|
echo "EOF"
|
||||||
|
} >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
run: |
|
||||||
|
printf '%s' "${{ secrets.REGISTRY_PASSWORD }}" \
|
||||||
|
| docker login "${{ vars.REGISTRY }}" \
|
||||||
|
--username "${{ secrets.REGISTRY_USERNAME }}" \
|
||||||
|
--password-stdin
|
||||||
|
|
||||||
|
- name: Build and push image
|
||||||
|
env:
|
||||||
|
DOCKER_BUILDKIT: "1"
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
tags=""
|
||||||
|
while IFS= read -r tag; do
|
||||||
|
tags="${tags} -t ${tag}"
|
||||||
|
done <<'EOF'
|
||||||
|
${{ steps.meta.outputs.tags }}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
docker build ${tags} .
|
||||||
|
|
||||||
|
while IFS= read -r tag; do
|
||||||
|
docker push "${tag}"
|
||||||
|
done <<'EOF'
|
||||||
|
${{ steps.meta.outputs.tags }}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Trigger Dokploy deployment
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if [ -z "${{ secrets.DOKPLOY_WEBHOOK_URL }}" ]; then
|
||||||
|
echo "::error::Set the DOKPLOY_WEBHOOK_URL repository secret."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -fsS -X POST "${{ secrets.DOKPLOY_WEBHOOK_URL }}"
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
-o "bin/md-to-html-${GOOS}-${GOARCH}" \
|
-o "bin/md-to-html-${GOOS}-${GOARCH}" \
|
||||||
./cmd/md-to-html
|
./cmd/md-to-html
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: md-to-html-${{ matrix.goos }}-${{ matrix.goarch }}
|
name: md-to-html-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
path: bin/md-to-html-${{ matrix.goos }}-${{ matrix.goarch }}
|
path: bin/md-to-html-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
|
|||||||
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
+1274
-258
File diff suppressed because it is too large
Load Diff
@@ -114,10 +114,7 @@ templ Home() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-wrap items-center justify-between gap-3 border-t border-border px-4 py-4">
|
<div class="flex flex-wrap items-center justify-end gap-3 border-t border-border px-4 py-4">
|
||||||
<p class="text-xs text-muted-foreground">
|
|
||||||
Конвертация использует публичный <code class="font-mono text-foreground">GitHub API</code>
|
|
||||||
</p>
|
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="reset"
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ func Home() templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<span>Поддерживается CommonMark + GFM</span></p></div></div><div class=\"flex flex-wrap items-center justify-between gap-3 border-t border-border px-4 py-4\"><p class=\"text-xs text-muted-foreground\">Конвертация использует публичный <code class=\"font-mono text-foreground\">GitHub API</code></p><div class=\"flex items-center gap-2\"><button type=\"reset\" class=\"focus-ring inline-flex h-9 items-center justify-center rounded-md border border-border bg-background px-3.5 text-sm font-medium text-foreground transition hover:bg-muted\">Сбросить</button> <button type=\"submit\" class=\"focus-ring inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition hover:bg-primary/90\"><span>Конвертировать</span>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<span>Поддерживается CommonMark + GFM</span></p></div></div><div class=\"flex flex-wrap items-center justify-end gap-3 border-t border-border px-4 py-4\"><div class=\"flex items-center gap-2\"><button type=\"reset\" class=\"focus-ring inline-flex h-9 items-center justify-center rounded-md border border-border bg-background px-3.5 text-sm font-medium text-foreground transition hover:bg-muted\">Сбросить</button> <button type=\"submit\" class=\"focus-ring inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition hover:bg-primary/90\"><span>Конвертировать</span>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|||||||
+1274
-258
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user