-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4b2b5e
commit 6b3be0d
Showing
177 changed files
with
10,181 additions
and
8,134 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json", | ||
"name": "default", | ||
"image": "golang:1.22-bookworm", | ||
"features": { | ||
"ghcr.io/guiyomh/features/golangci-lint:0": {}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
"ghcr.io/devcontainers/features/sshd:1": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"streetsidesoftware.code-spell-checker" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": "go mod download" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
## Except the following files and directories | ||
!/cmd | ||
!/internal | ||
!/l10n | ||
!/templates | ||
!/error-pages.yml | ||
!/go.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-release-config.json | ||
# docs: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes | ||
|
||
changelog: | ||
categories: | ||
- title: 🛠 Fixes | ||
labels: [type:fix, type:bug] | ||
- title: 🚀 Features | ||
labels: [type:feature, type:feature_request] | ||
- title: 📦 Dependency updates | ||
labels: [dependencies] | ||
- title: Other Changes | ||
labels: ['*'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,105 @@ | ||
name: release | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
# docs: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | ||
|
||
name: 🚀 Release | ||
|
||
on: | ||
release: # Docs: <https://git.io/JeBz1#release-event-release> | ||
types: [published] | ||
|
||
jobs: | ||
purge-cdn-cache: | ||
name: Purge jsDelivr CDN cache | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: gacts/purge-jsdelivr-cache@v1 # Action page: <https://github.com/gacts/purge-jsdelivr-cache> | ||
with: | ||
url: | | ||
https://cdn.jsdelivr.net/gh/tarampampam/error-pages@2/l10n/l10n.js | ||
https://cdn.jsdelivr.net/gh/tarampampam/error-pages@2/l10n/l10n.min.js | ||
https://cdn.jsdelivr.net/gh/tarampampam/error-pages@latest/l10n/l10n.js | ||
https://cdn.jsdelivr.net/gh/tarampampam/error-pages@latest/l10n/l10n.min.js | ||
build: | ||
name: Build for ${{ matrix.os }} (${{ matrix.arch }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [linux, darwin] # linux, freebsd, darwin, windows | ||
arch: [amd64] # amd64, 386 | ||
os: [linux, darwin, windows] # freebsd | ||
arch: [amd64, arm64] # 386 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: gacts/setup-go-with-cache@v1 | ||
with: {go-version-file: go.mod} | ||
|
||
- {uses: actions/setup-go@v5, with: {go-version-file: go.mod}} | ||
- {uses: gacts/github-slug@v1, id: slug} | ||
|
||
- name: Generate builder values | ||
id: values | ||
run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT | ||
|
||
- name: Build application | ||
env: | ||
- id: values | ||
run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" >> $GITHUB_OUTPUT | ||
- env: | ||
GOOS: ${{ matrix.os }} | ||
GOARCH: ${{ matrix.arch }} | ||
CGO_ENABLED: 0 | ||
LDFLAGS: -s -w -X gh.tarampamp.am/error-pages/internal/version.version=${{ steps.slug.outputs.version }} | ||
run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/error-pages/ | ||
|
||
- name: Upload binary file to release | ||
uses: svenstaro/upload-release-action@v2 | ||
- uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ steps.values.outputs.binary-name }} | ||
asset_name: ${{ steps.values.outputs.binary-name }} | ||
tag: ${{ github.ref }} | ||
|
||
- if: matrix.os == 'linux' && matrix.arch == 'amd64' | ||
run: mkdir ./out && ./${{ steps.values.outputs.binary-name }} build --index --target-dir ./out | ||
- if: matrix.os == 'linux' && matrix.arch == 'amd64' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: error-pages-static | ||
path: out/ | ||
if-no-files-found: error | ||
retention-days: 1 | ||
- if: matrix.os == 'linux' && matrix.arch == 'amd64' | ||
working-directory: ./out | ||
run: zip -r ./../templates.zip . | ||
- if: matrix.os == 'linux' && matrix.arch == 'amd64' | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: templates.zip | ||
asset_name: error-pages-static.zip | ||
tag: ${{ github.ref }} | ||
|
||
demo: | ||
name: Update the demo (GitHub Pages) | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: error-pages-static | ||
path: .artifact | ||
- uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./.artifact | ||
|
||
docker-image: | ||
name: Build docker image | ||
name: Build the docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- {uses: gacts/github-slug@v1, id: slug} | ||
|
||
- uses: docker/setup-qemu-action@v3 # Action page: <https://github.com/docker/setup-qemu-action> | ||
|
||
- uses: docker/setup-buildx-action@v3 # Action page: <https://github.com/docker/setup-buildx-action> | ||
|
||
- uses: docker/login-action@v3 # Action page: <https://github.com/docker/login-action> | ||
- uses: docker/setup-qemu-action@v3 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_LOGIN }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- uses: docker/login-action@v3 # Action page: <https://github.com/docker/login-action> | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/build-push-action@v5 # Action page: <https://github.com/docker/build-push-action> | ||
- uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 | ||
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 | ||
build-args: "APP_VERSION=${{ steps.slug.outputs.version }}" | ||
tags: | | ||
tarampampam/error-pages:${{ steps.slug.outputs.version }} | ||
tarampampam/error-pages:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }} | ||
tarampampam/error-pages:${{ steps.slug.outputs.version-major }} | ||
tarampampam/error-pages:latest | ||
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }} | ||
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }} | ||
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }} | ||
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest | ||
demo: | ||
name: Update the demonstration | ||
runs-on: ubuntu-latest | ||
needs: [docker-image] | ||
steps: | ||
- {uses: gacts/github-slug@v1, id: slug} | ||
|
||
- name: Take rendered templates from the built docker image | ||
run: | | ||
docker create --name img ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }} | ||
docker cp img:/opt/html ./out | ||
docker rm -f img | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./out | ||
tags: ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }} | ||
# tags: | # TODO: uncomment after the stable release | ||
# tarampampam/error-pages:latest | ||
# tarampampam/error-pages:${{ steps.slug.outputs.version }} | ||
# tarampampam/error-pages:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }} | ||
# tarampampam/error-pages:${{ steps.slug.outputs.version-major }} | ||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest | ||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }} | ||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }} | ||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }} |
Oops, something went wrong.