Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b76d612d55 | ||
|
|
8dc7ad3d90 | ||
|
|
0c605c4dfb | ||
|
|
2a063481a6 | ||
|
|
2fbeeef59d | ||
|
|
84f0f43ae8 |
No files matched your search
@@ -0,0 +1,73 @@
|
|||||||
|
name: Create Gitea release
|
||||||
|
description: Create or update a stable release or prerelease for the current commit
|
||||||
|
inputs:
|
||||||
|
token:
|
||||||
|
required: true
|
||||||
|
description: Gitea API token
|
||||||
|
prerelease:
|
||||||
|
required: true
|
||||||
|
description: Whether to publish a prerelease
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Create or update Gitea release
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ inputs.token }}
|
||||||
|
GITEA_API_URL: ${{ gitea.api_url }}
|
||||||
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||||
|
GITEA_SHA: ${{ gitea.sha }}
|
||||||
|
RELEASE_IS_PRERELEASE: ${{ inputs.prerelease }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
version="$(git rev-parse --short=12 "$GITEA_SHA")"
|
||||||
|
if [[ ! "$version" =~ ^[0-9a-f]{12}$ ]]; then
|
||||||
|
echo "Invalid git hash version: $version" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
release_tag="v$version"
|
||||||
|
if [ "$RELEASE_IS_PRERELEASE" = true ]; then
|
||||||
|
release_tag="$release_tag-dev"
|
||||||
|
fi
|
||||||
|
|
||||||
|
releases_url="$GITEA_API_URL/repos/$GITEA_REPOSITORY/releases"
|
||||||
|
auth_header="Authorization: token $GITEA_TOKEN"
|
||||||
|
previous_tag="$(curl --fail --silent --show-error --header "$auth_header" "$releases_url?limit=100" | jq -r --arg tag "$release_tag" --argjson prerelease "$RELEASE_IS_PRERELEASE" '[.[] | select(.draft == false and .prerelease == $prerelease and .tag_name != $tag)][0].tag_name // empty')"
|
||||||
|
|
||||||
|
if [ -n "$previous_tag" ]; then
|
||||||
|
commit_messages="$(git log --reverse --format='- %s' "${previous_tag}..${GITEA_SHA}")"
|
||||||
|
full_changelog="$GITEA_SERVER_URL/$GITEA_REPOSITORY/compare/${previous_tag}...$release_tag"
|
||||||
|
else
|
||||||
|
commit_messages="$(git log --reverse --format='- %s' "$GITEA_SHA")"
|
||||||
|
full_changelog=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$commit_messages" ]; then
|
||||||
|
commit_messages="- No commits since the previous release"
|
||||||
|
fi
|
||||||
|
|
||||||
|
{
|
||||||
|
echo '## Changes'
|
||||||
|
echo
|
||||||
|
printf '%s\n' "$commit_messages"
|
||||||
|
echo
|
||||||
|
if [ -n "$full_changelog" ]; then
|
||||||
|
echo "**Full Changelog**: $full_changelog"
|
||||||
|
fi
|
||||||
|
} > release-notes.md
|
||||||
|
|
||||||
|
payload="$(jq -Rs --arg tag "$release_tag" --arg target "$GITEA_SHA" --argjson prerelease "$RELEASE_IS_PRERELEASE" '{tag_name: $tag, target_commitish: $target, name: $tag, body: ., draft: false, prerelease: $prerelease}' release-notes.md)"
|
||||||
|
status="$(curl --silent --show-error --output release.json --write-out '%{http_code}' --header "$auth_header" "$releases_url/tags/$release_tag")"
|
||||||
|
|
||||||
|
if [ "$status" = 200 ]; then
|
||||||
|
release_id="$(jq -r '.id' release.json)"
|
||||||
|
curl --fail-with-body --silent --show-error --request PATCH --header "$auth_header" --header 'Content-Type: application/json' --data "$payload" "$releases_url/$release_id"
|
||||||
|
elif [ "$status" = 404 ]; then
|
||||||
|
curl --fail-with-body --silent --show-error --request POST --header "$auth_header" --header 'Content-Type: application/json' --data "$payload" "$releases_url"
|
||||||
|
else
|
||||||
|
cat release.json
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
name: Publish Docker image
|
||||||
|
description: Build and push the maintenance image
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
required: true
|
||||||
|
description: Docker image tag
|
||||||
|
username:
|
||||||
|
required: true
|
||||||
|
description: Registry username
|
||||||
|
password:
|
||||||
|
required: true
|
||||||
|
description: Registry password
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4.4.1
|
||||||
|
|
||||||
|
- name: Log in to registry
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
REGISTRY_USERNAME: ${{ inputs.username }}
|
||||||
|
REGISTRY_PASSWORD: ${{ inputs.password }}
|
||||||
|
run: printf '%s' "$REGISTRY_PASSWORD" | docker login "$REGISTRY" --username "$REGISTRY_USERNAME" --password-stdin
|
||||||
|
|
||||||
|
- name: Build and push image
|
||||||
|
uses: docker/build-push-action@v7.4.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
provenance: false
|
||||||
|
build-args: |
|
||||||
|
APP_VERSION=${{ gitea.sha }}
|
||||||
|
VCS_REF=${{ gitea.sha }}
|
||||||
|
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.version=${{ gitea.sha }}
|
||||||
|
org.opencontainers.image.revision=${{ gitea.sha }}
|
||||||
|
org.opencontainers.image.source=${{ gitea.repositoryUrl }}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Release Development
|
name: CD Development
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
actions: read
|
actions: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -30,7 +30,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
runs_url="$GITEA_API_URL/repos/$GITEA_REPOSITORY/actions/runs?limit=100"
|
runs_url="$GITEA_API_URL/repos/$GITEA_REPOSITORY/actions/runs?limit=100"
|
||||||
runs="$(curl --fail --silent --show-error --header "Authorization: token $GITEA_TOKEN" "$runs_url")"
|
runs="$(curl --fail --silent --show-error --header "Authorization: token $GITEA_TOKEN" "$runs_url")"
|
||||||
previous_sha="$(jq -r --arg path '.gitea/workflows/ReleaseDevelopment.yml' '[.workflow_runs[] | select(.path == $path and .status == "success")][0].head_sha // empty' <<< "$runs")"
|
previous_sha="$(jq -r --arg path '.gitea/workflows/CD Development.yml' '[.workflow_runs[] | select(.path == $path and .status == "success")][0].head_sha // empty' <<< "$runs")"
|
||||||
|
|
||||||
if [ "$previous_sha" = "$GITEA_SHA" ]; then
|
if [ "$previous_sha" = "$GITEA_SHA" ]; then
|
||||||
echo 'changed=false' >> "$GITEA_OUTPUT"
|
echo 'changed=false' >> "$GITEA_OUTPUT"
|
||||||
@@ -40,36 +40,25 @@ jobs:
|
|||||||
echo 'Changes found; development release will run.'
|
echo 'Changes found; development release will run.'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
image:
|
publish:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.changed == 'true'
|
if: needs.changes.outputs.changed == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7.0.1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Publish Docker image
|
||||||
|
uses: ./.gitea/actions/publish-image
|
||||||
|
with:
|
||||||
|
tag: dev
|
||||||
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and push development image
|
- name: Create Gitea prerelease
|
||||||
uses: docker/build-push-action@v6
|
uses: ./.gitea/actions/create-release
|
||||||
with:
|
with:
|
||||||
context: .
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
push: true
|
prerelease: 'true'
|
||||||
provenance: false
|
|
||||||
build-args: |
|
|
||||||
APP_VERSION=${{ gitea.sha }}
|
|
||||||
VCS_REF=${{ gitea.sha }}
|
|
||||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.version=${{ gitea.sha }}
|
|
||||||
org.opencontainers.image.revision=${{ gitea.sha }}
|
|
||||||
org.opencontainers.image.source=${{ gitea.repositoryUrl }}
|
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
name: CD Production
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: docker.lechner-systems.at
|
||||||
|
IMAGE_NAME: lechnersystems/maintenance
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v7.0.1
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Publish Docker image
|
||||||
|
uses: ./.gitea/actions/publish-image
|
||||||
|
with:
|
||||||
|
tag: latest
|
||||||
|
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Create Gitea stable release
|
||||||
|
uses: ./.gitea/actions/create-release
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
prerelease: 'false'
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7.0.1
|
||||||
|
|
||||||
- name: Check JavaScript syntax
|
- name: Check JavaScript syntax
|
||||||
run: node --check script.js
|
run: node --check script.js
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7.0.1
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build --build-arg APP_VERSION=${{ gitea.sha }} --build-arg VCS_REF=${{ gitea.sha }} --tag "$REGISTRY/$IMAGE_NAME:ci-${{ gitea.sha }}" .
|
run: docker build --build-arg APP_VERSION=${{ gitea.sha }} --build-arg VCS_REF=${{ gitea.sha }} --tag "$REGISTRY/$IMAGE_NAME:ci-${{ gitea.sha }}" .
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
name: Release Production
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: docker.lechner-systems.at
|
|
||||||
IMAGE_NAME: lechnersystems/maintenance
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
image:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push production image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
build-args: |
|
|
||||||
APP_VERSION=${{ gitea.sha }}
|
|
||||||
VCS_REF=${{ gitea.sha }}
|
|
||||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.version=${{ gitea.sha }}
|
|
||||||
org.opencontainers.image.revision=${{ gitea.sha }}
|
|
||||||
org.opencontainers.image.source=${{ gitea.repositoryUrl }}
|
|
||||||
|
|
||||||
release:
|
|
||||||
needs: image
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Create or update Gitea release
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
GITEA_API_URL: ${{ gitea.api_url }}
|
|
||||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
||||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
|
||||||
GITEA_SHA: ${{ gitea.sha }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
version="$(git rev-parse --short=12 "$GITEA_SHA")"
|
|
||||||
if [[ ! "$version" =~ ^[0-9a-f]{12}$ ]]; then
|
|
||||||
echo "Invalid git hash version: $version" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
release_tag="v$version"
|
|
||||||
releases_url="$GITEA_API_URL/repos/$GITEA_REPOSITORY/releases"
|
|
||||||
auth_header="Authorization: token $GITEA_TOKEN"
|
|
||||||
previous_tag="$(curl --fail --silent --show-error --header "$auth_header" "$releases_url?limit=100" | jq -r --arg tag "$release_tag" '[.[] | select(.draft == false and .prerelease == false and .tag_name != $tag)][0].tag_name // empty')"
|
|
||||||
|
|
||||||
if [ -n "$previous_tag" ]; then
|
|
||||||
commit_messages="$(git log --reverse --format='- %s' "${previous_tag}..${GITEA_SHA}")"
|
|
||||||
full_changelog="$GITEA_SERVER_URL/$GITEA_REPOSITORY/compare/${previous_tag}...$release_tag"
|
|
||||||
else
|
|
||||||
commit_messages="$(git log --reverse --format='- %s' "$GITEA_SHA")"
|
|
||||||
full_changelog=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$commit_messages" ]; then
|
|
||||||
commit_messages="- No commits since the previous release"
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
|
||||||
echo '## Changes'
|
|
||||||
echo
|
|
||||||
printf '%s\n' "$commit_messages"
|
|
||||||
echo
|
|
||||||
if [ -n "$full_changelog" ]; then
|
|
||||||
echo "**Full Changelog**: $full_changelog"
|
|
||||||
fi
|
|
||||||
} > release-notes.md
|
|
||||||
|
|
||||||
payload="$(jq -Rs --arg tag "$release_tag" --arg target "$GITEA_SHA" '{tag_name: $tag, target_commitish: $target, name: $tag, body: ., draft: false, prerelease: false}' release-notes.md)"
|
|
||||||
status="$(curl --silent --show-error --output release.json --write-out '%{http_code}' --header "$auth_header" "$releases_url/tags/$release_tag")"
|
|
||||||
|
|
||||||
if [ "$status" = 200 ]; then
|
|
||||||
release_id="$(jq -r '.id' release.json)"
|
|
||||||
curl --fail-with-body --silent --show-error --request PATCH --header "$auth_header" --header 'Content-Type: application/json' --data "$payload" "$releases_url/$release_id"
|
|
||||||
elif [ "$status" = 404 ]; then
|
|
||||||
curl --fail-with-body --silent --show-error --request POST --header "$auth_header" --header 'Content-Type: application/json' --data "$payload" "$releases_url"
|
|
||||||
else
|
|
||||||
cat release.json
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM nginx:1.27-alpine
|
FROM nginx:1.31.6-alpine3.24
|
||||||
|
|
||||||
ARG VCS_REF=unknown
|
ARG VCS_REF=unknown
|
||||||
ARG APP_VERSION=unknown
|
ARG APP_VERSION=unknown
|
||||||
|
|||||||
@@ -1,16 +1,64 @@
|
|||||||
# HTML Simple Maintenance Page
|
# Maintenance Website
|
||||||
|
|
||||||
### [🙋♂️ Website Preview](https://lechner-systems.at/)
|
A lightweight maintenance page served as a static website.
|
||||||
|
|
||||||
### 🪪 License
|
## Preview
|
||||||
Icons: [Icons8.com](https://icons8.com/)
|
|
||||||
|
|
||||||
Modified by Julian Lechner.
|
[Open the live preview](https://lechner-systems.at/)
|
||||||
Based on Simple Maintenance Page by theoricher.
|
|
||||||
Licensed under GNU GPL v3.
|
|
||||||
|
|
||||||
## 🤝 Enjoy?
|
## Technology
|
||||||
|
|
||||||
Give it a star ⭐ on [Gitea](https://git.lechner-systems.at/FrauJulian/Personal-Portfolio-Website)!
|
- HTML, CSS, and vanilla JavaScript
|
||||||
|
- Nginx
|
||||||
|
- Docker and Docker Compose
|
||||||
|
|
||||||
### Greetings from Austria! ⛰️
|
## Features
|
||||||
|
|
||||||
|
- Selects a maintenance message from the browser's preferred language, with English fallback
|
||||||
|
- Supports English, German, Slovak, Czech, Dutch, Swedish, Norwegian, Polish, Italian, French, Spanish, Slovenian, and Danish
|
||||||
|
- Provides email, abuse, phone, imprint, and status links
|
||||||
|
|
||||||
|
## Project Architecture
|
||||||
|
|
||||||
|
- `index.html` — page content and contact links
|
||||||
|
- `style.css` — page layout and styling
|
||||||
|
- `script.js` — language selection
|
||||||
|
- `images/` — page images and icons
|
||||||
|
- `nginx.conf` — web server configuration
|
||||||
|
- `Dockerfile` — production image definition
|
||||||
|
- `docker-compose.yml` — production service configuration
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
### Development
|
||||||
|
|
||||||
|
From the project root, start a local static server:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python -m http.server 8000
|
||||||
|
```
|
||||||
|
|
||||||
|
Open <http://localhost:8000>.
|
||||||
|
|
||||||
|
### Production
|
||||||
|
|
||||||
|
Requires Docker Compose and access to the configured image registry. Copy the example environment file, set `IMAGE_TAG` if needed, then start the service:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cp .env.example .env
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
The page is available at <http://localhost:8080> by default. Set `MAIN_PORT` in `.env` to change the host port.
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
There is no dedicated test suite. CI checks JavaScript syntax with `node --check` and builds the Docker image.
|
||||||
|
|
||||||
|
## Guidelines
|
||||||
|
|
||||||
|
Use the issue templates in [`.gitea/ISSUE_TEMPLATE`](.gitea/ISSUE_TEMPLATE) for bug reports and feature requests.
|
||||||
|
|
||||||
|
## LICENSE
|
||||||
|
|
||||||
|
The project is licensed under the [GNU General Public License v3](LICENSE). Icons by [Icons8](https://icons8.com/).
|
||||||
Reference in new issue
Block a user