mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
wip: 🔕 temporary commit
This commit is contained in:
127
.github/workflows/release.yml
vendored
127
.github/workflows/release.yml
vendored
@ -14,91 +14,70 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [linux, darwin] # linux, freebsd, darwin, windows
|
os: [linux, darwin, windows] # freebsd
|
||||||
arch: [amd64] # amd64, 386
|
arch: [amd64, arm64] # 386
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- {uses: actions/setup-go@v5, with: {go-version-file: go.mod}}
|
||||||
- uses: gacts/setup-go-with-cache@v1
|
|
||||||
with: {go-version-file: go.mod}
|
|
||||||
|
|
||||||
- {uses: gacts/github-slug@v1, id: slug}
|
- {uses: gacts/github-slug@v1, id: slug}
|
||||||
|
- id: values
|
||||||
- name: Generate builder values
|
run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" >> $GITHUB_OUTPUT
|
||||||
id: values
|
- env:
|
||||||
run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Build application
|
|
||||||
env:
|
|
||||||
GOOS: ${{ matrix.os }}
|
GOOS: ${{ matrix.os }}
|
||||||
GOARCH: ${{ matrix.arch }}
|
GOARCH: ${{ matrix.arch }}
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
LDFLAGS: -s -w -X gh.tarampamp.am/error-pages/internal/version.version=${{ steps.slug.outputs.version }}
|
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/
|
run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/error-pages/
|
||||||
|
- uses: svenstaro/upload-release-action@v2
|
||||||
- name: Upload binary file to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: ${{ steps.values.outputs.binary-name }}
|
file: ${{ steps.values.outputs.binary-name }}
|
||||||
asset_name: ${{ steps.values.outputs.binary-name }}
|
asset_name: ${{ steps.values.outputs.binary-name }}
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
|
|
||||||
# docker-image:
|
docker-image:
|
||||||
# name: Build docker image
|
name: Build the docker image
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# - uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
#
|
- {uses: gacts/github-slug@v1, id: slug}
|
||||||
# - {uses: gacts/github-slug@v1, id: slug}
|
- uses: docker/setup-qemu-action@v3
|
||||||
#
|
- uses: docker/setup-buildx-action@v3
|
||||||
# - uses: docker/setup-qemu-action@v3 # Action page: <https://github.com/docker/setup-qemu-action>
|
- uses: docker/login-action@v3
|
||||||
#
|
with:
|
||||||
# - uses: docker/setup-buildx-action@v3 # Action page: <https://github.com/docker/setup-buildx-action>
|
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:
|
with:
|
||||||
# username: ${{ secrets.DOCKER_LOGIN }}
|
registry: ghcr.io
|
||||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
username: ${{ github.actor }}
|
||||||
#
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# - uses: docker/login-action@v3 # Action page: <https://github.com/docker/login-action>
|
- uses: docker/build-push-action@v5
|
||||||
# with:
|
with:
|
||||||
# registry: ghcr.io
|
context: .
|
||||||
# username: ${{ github.actor }}
|
file: Dockerfile
|
||||||
# password: ${{ secrets.GITHUB_TOKEN }}
|
push: true
|
||||||
#
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8
|
||||||
# - uses: docker/build-push-action@v5 # Action page: <https://github.com/docker/build-push-action>
|
build-args: "APP_VERSION=${{ steps.slug.outputs.version }}"
|
||||||
# with:
|
tags: | # TODO: add `tarampampam/error-pages:latest` and `ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest`
|
||||||
# context: .
|
tarampampam/error-pages:${{ steps.slug.outputs.version }}
|
||||||
# file: Dockerfile
|
tarampampam/error-pages:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
|
||||||
# push: true
|
tarampampam/error-pages:${{ steps.slug.outputs.version-major }}
|
||||||
# platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8
|
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }}
|
||||||
# build-args: "APP_VERSION=${{ steps.slug.outputs.version }}"
|
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
|
||||||
# tags: |
|
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}
|
||||||
# tarampampam/error-pages:${{ steps.slug.outputs.version }}
|
|
||||||
# tarampampam/error-pages:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
|
demo:
|
||||||
# tarampampam/error-pages:${{ steps.slug.outputs.version-major }}
|
name: Update the demo (GitHub Pages)
|
||||||
# tarampampam/error-pages:latest
|
runs-on: ubuntu-latest
|
||||||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }}
|
needs: [docker-image]
|
||||||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
|
steps:
|
||||||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}
|
- {uses: gacts/github-slug@v1, id: slug}
|
||||||
# ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest
|
- run: |
|
||||||
#
|
docker create --name img ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }}
|
||||||
# demo:
|
docker cp img:/opt/html ./out
|
||||||
# name: Update the demonstration
|
docker rm -f img
|
||||||
# runs-on: ubuntu-latest
|
- uses: peaceiris/actions-gh-pages@v4
|
||||||
# needs: [docker-image]
|
with:
|
||||||
# steps:
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# - {uses: gacts/github-slug@v1, id: slug}
|
publish_dir: ./out
|
||||||
#
|
|
||||||
# - 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
|
|
||||||
|
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@ -83,10 +83,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- {uses: gacts/github-slug@v1, id: slug}
|
- {uses: gacts/github-slug@v1, id: slug}
|
||||||
|
- uses: docker/setup-qemu-action@v3
|
||||||
|
- uses: docker/setup-buildx-action@v3
|
||||||
- uses: docker/build-push-action@v5
|
- uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
push: false
|
push: false
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8
|
||||||
build-args: "APP_VERSION=${{ steps.slug.outputs.commit-hash-short }}"
|
build-args: "APP_VERSION=${{ steps.slug.outputs.commit-hash-short }}"
|
||||||
tags: app:ci
|
tags: app:ci
|
||||||
|
Reference in New Issue
Block a user