-
Notifications
You must be signed in to change notification settings - Fork 89
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
ce98410
commit 29f024e
Showing
66 changed files
with
3,912 additions
and
705 deletions.
There are no files selected for viewing
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,26 @@ | ||
# Docs: <https://docs.codecov.io/docs/commit-status> | ||
|
||
coverage: | ||
# coverage lower than 50 is red, higher than 90 green | ||
range: 30..80 | ||
|
||
status: | ||
project: | ||
default: | ||
# Choose a minimum coverage ratio that the commit must meet to be considered a success. | ||
# | ||
# `auto` will use the coverage from the base commit (pull request base or parent commit) coverage to compare | ||
# against. | ||
target: auto | ||
|
||
# Allow the coverage to drop by X%, and posting a success status. | ||
threshold: 5% | ||
|
||
# Resulting status will pass no matter what the coverage is or what other settings are specified. | ||
informational: true | ||
|
||
patch: | ||
default: | ||
target: auto | ||
threshold: 5% | ||
informational: true |
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,7 +1,14 @@ | ||
.dockerignore | ||
Dockerfile | ||
.github | ||
.git | ||
.gitignore | ||
/generator/node_modules | ||
/generator/*.log | ||
/out | ||
.editorconfig | ||
.idea | ||
.vscode | ||
test | ||
temp | ||
tmp | ||
LICENSE | ||
Makefile | ||
error-pages |
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 |
---|---|---|
|
@@ -5,100 +5,96 @@ on: | |
types: [published] | ||
|
||
jobs: | ||
demo: | ||
name: Update demonstration, hosted on github pages | ||
build: | ||
name: Build for ${{ matrix.os }} (${{ matrix.arch }}) | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [linux, darwin] # linux, freebsd, darwin, windows | ||
arch: [amd64] # amd64, 386 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v1 # Action page: <https://github.com/actions/setup-node> | ||
with: | ||
node-version: 15 | ||
- uses: actions/setup-go@v2 | ||
with: {go-version: 1.17.1} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
working-directory: generator | ||
run: yarn install | ||
|
||
- name: Generate pages | ||
run: ./generator/generator.js -i -c ./config.json -o ./out | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: content | ||
path: out/ | ||
retention-days: 1 | ||
- uses: gacts/github-slug@v1 | ||
id: slug | ||
|
||
- name: Switch to github pages branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: gh-pages | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
- name: Generate builder values | ||
id: values | ||
run: echo "::set-output name=binary-name::error-pages-${{ matrix.os }}-${{ matrix.arch }}" | ||
|
||
- name: Build application | ||
env: | ||
GOOS: ${{ matrix.os }} | ||
GOARCH: ${{ matrix.arch }} | ||
CGO_ENABLED: 0 | ||
LDFLAGS: -s -w -X github.com/tarampampam/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 | ||
with: | ||
name: content | ||
|
||
- name: Setup git | ||
run: | | ||
git config --global user.name "$GITHUB_ACTOR" | ||
git config --global user.email '[email protected]' | ||
git remote add github "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" | ||
- name: Stage changes | ||
run: git add . | ||
|
||
- name: Commit changes | ||
run: git commit --allow-empty -m "Deploying ${GITHUB_SHA} to Github Pages" | ||
|
||
- name: Push changes | ||
run: git push github --force | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ steps.values.outputs.binary-name }} | ||
asset_name: ${{ steps.values.outputs.binary-name }} | ||
tag: ${{ github.ref }} | ||
|
||
docker-image: | ||
name: Build docker image | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: gacts/github-slug@v1 | ||
id: slug | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 # Action page: <https://github.com/docker/setup-qemu-action> | ||
- uses: docker/setup-qemu-action@v1 # Action page: <https://github.com/docker/setup-qemu-action> | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 # Action page: <https://github.com/docker/setup-buildx-action> | ||
- uses: docker/setup-buildx-action@v1 # Action page: <https://github.com/docker/setup-buildx-action> | ||
|
||
- name: Login to default Container Registry | ||
uses: docker/login-action@v1 # Action page: <https://github.com/docker/login-action> | ||
- uses: docker/login-action@v1 # Action page: <https://github.com/docker/login-action> | ||
with: | ||
username: ${{ secrets.DOCKER_LOGIN }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 # Action page: <https://github.com/docker/login-action> | ||
- uses: docker/login-action@v1 # Action page: <https://github.com/docker/login-action> | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GHCR_PASSWORD }} | ||
|
||
- name: Generate builder values | ||
id: values | ||
run: echo "::set-output name=version::${GITHUB_REF##*/[vV]}" # `/refs/tags/v1.2.3` -> `1.2.3` | ||
- uses: docker/build-push-action@v2 # Action page: <https://github.com/docker/build-push-action> | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 | ||
build-args: "APP_VERSION=${{ steps.slug.outputs.version }}" | ||
tags: | | ||
tarampampam/error-pages:${{ steps.slug.outputs.version }} | ||
tarampampam/error-pages:latest | ||
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }} | ||
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest | ||
- name: Build image | ||
demo: | ||
name: Update the demonstration | ||
runs-on: ubuntu-20.04 | ||
needs: [docker-image] | ||
steps: | ||
- uses: gacts/github-slug@v1 | ||
id: slug | ||
|
||
- name: Take rendered templates from the built docker image | ||
run: | | ||
docker buildx build \ | ||
--platform "linux/amd64,linux/arm64/v8,linux/arm/v6,linux/arm/v7" \ | ||
--tag "tarampampam/error-pages:${{ steps.values.outputs.version }}" \ | ||
--tag "tarampampam/error-pages:latest" \ | ||
--tag "ghcr.io/${{ github.actor }}/error-pages:${{ steps.values.outputs.version }}" \ | ||
--tag "ghcr.io/${{ github.actor }}/error-pages:latest" \ | ||
--file ./Dockerfile \ | ||
--push \ | ||
. | ||
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@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./out |
Oops, something went wrong.