|
8 | 8 | types: [published] |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - build: |
12 | | - name: Build for ${{ matrix.os }} (${{ matrix.arch }}) |
13 | | - runs-on: ubuntu-latest |
14 | | - strategy: |
15 | | - fail-fast: false |
16 | | - matrix: |
17 | | - os: [linux, darwin, windows] # freebsd |
18 | | - arch: [amd64, arm64] # 386 |
19 | | - steps: |
20 | | - - uses: actions/checkout@v4 |
21 | | - - {uses: actions/setup-go@v5, with: {go-version-file: go.mod}} |
22 | | - - {uses: gacts/github-slug@v1, id: slug} |
23 | | - - id: values |
24 | | - run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" >> $GITHUB_OUTPUT |
25 | | - - env: |
26 | | - GOOS: ${{ matrix.os }} |
27 | | - GOARCH: ${{ matrix.arch }} |
28 | | - CGO_ENABLED: 0 |
29 | | - LDFLAGS: -s -w -X gh.tarampamp.am/error-pages/internal/version.version=${{ steps.slug.outputs.version }} |
30 | | - run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/error-pages/ |
31 | | - - uses: svenstaro/upload-release-action@v2 |
32 | | - with: |
33 | | - repo_token: ${{ secrets.GITHUB_TOKEN }} |
34 | | - file: ${{ steps.values.outputs.binary-name }} |
35 | | - asset_name: ${{ steps.values.outputs.binary-name }} |
36 | | - tag: ${{ github.ref }} |
| 11 | + # build: |
| 12 | + # name: Build for ${{ matrix.os }} (${{ matrix.arch }}) |
| 13 | + # runs-on: ubuntu-latest |
| 14 | + # strategy: |
| 15 | + # fail-fast: false |
| 16 | + # matrix: |
| 17 | + # os: [linux, darwin, windows] # freebsd |
| 18 | + # arch: [amd64, arm64] # 386 |
| 19 | + # steps: |
| 20 | + # - uses: actions/checkout@v4 |
| 21 | + # - {uses: actions/setup-go@v5, with: {go-version-file: go.mod}} |
| 22 | + # - {uses: gacts/github-slug@v1, id: slug} |
| 23 | + # - id: values |
| 24 | + # run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" >> $GITHUB_OUTPUT |
| 25 | + # - env: |
| 26 | + # GOOS: ${{ matrix.os }} |
| 27 | + # GOARCH: ${{ matrix.arch }} |
| 28 | + # CGO_ENABLED: 0 |
| 29 | + # LDFLAGS: -s -w -X gh.tarampamp.am/error-pages/internal/version.version=${{ steps.slug.outputs.version }} |
| 30 | + # run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/error-pages/ |
| 31 | + # - uses: svenstaro/upload-release-action@v2 |
| 32 | + # with: |
| 33 | + # repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + # file: ${{ steps.values.outputs.binary-name }} |
| 35 | + # asset_name: ${{ steps.values.outputs.binary-name }} |
| 36 | + # tag: ${{ github.ref }} |
37 | 37 |
|
38 | | - - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
39 | | - run: mkdir ./out && ./${{ steps.values.outputs.binary-name }} build --index --disable-minification --target-dir ./out |
40 | | - - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
41 | | - uses: actions/upload-artifact@v4 |
42 | | - with: |
43 | | - name: error-pages-static |
44 | | - path: out/ |
45 | | - if-no-files-found: error |
46 | | - retention-days: 1 |
47 | | - - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
48 | | - working-directory: ./out |
49 | | - run: zip -r ./../templates.zip . |
50 | | - - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
51 | | - uses: svenstaro/upload-release-action@v2 |
52 | | - with: |
53 | | - repo_token: ${{ secrets.GITHUB_TOKEN }} |
54 | | - file: templates.zip |
55 | | - asset_name: error-pages-static.zip |
56 | | - tag: ${{ github.ref }} |
| 38 | + # - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
| 39 | + # run: mkdir ./out && ./${{ steps.values.outputs.binary-name }} build --index --disable-minification --target-dir ./out |
| 40 | + # - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
| 41 | + # uses: actions/upload-artifact@v4 |
| 42 | + # with: |
| 43 | + # name: error-pages-static |
| 44 | + # path: out/ |
| 45 | + # if-no-files-found: error |
| 46 | + # retention-days: 1 |
| 47 | + # - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
| 48 | + # working-directory: ./out |
| 49 | + # run: zip -r ./../templates.zip . |
| 50 | + # - if: matrix.os == 'linux' && matrix.arch == 'amd64' |
| 51 | + # uses: svenstaro/upload-release-action@v2 |
| 52 | + # with: |
| 53 | + # repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + # file: templates.zip |
| 55 | + # asset_name: error-pages-static.zip |
| 56 | + # tag: ${{ github.ref }} |
57 | 57 |
|
58 | | - demo: |
59 | | - name: Update the demo (GitHub Pages) |
60 | | - runs-on: ubuntu-latest |
61 | | - needs: [build] |
62 | | - steps: |
63 | | - - uses: actions/download-artifact@v4 |
64 | | - with: |
65 | | - name: error-pages-static |
66 | | - path: .artifact |
67 | | - - uses: peaceiris/actions-gh-pages@v4 |
68 | | - with: |
69 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
70 | | - publish_dir: ./.artifact |
| 58 | + # demo: |
| 59 | + # name: Update the demo (GitHub Pages) |
| 60 | + # runs-on: ubuntu-latest |
| 61 | + # needs: [build] |
| 62 | + # steps: |
| 63 | + # - uses: actions/download-artifact@v4 |
| 64 | + # with: |
| 65 | + # name: error-pages-static |
| 66 | + # path: .artifact |
| 67 | + # - uses: peaceiris/actions-gh-pages@v4 |
| 68 | + # with: |
| 69 | + # github_token: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + # publish_dir: ./.artifact |
71 | 71 |
|
72 | 72 | docker-image: |
73 | 73 | name: Build the docker image |
|
77 | 77 | - {uses: gacts/github-slug@v1, id: slug} |
78 | 78 | - uses: docker/setup-qemu-action@v3 |
79 | 79 | - uses: docker/setup-buildx-action@v3 |
80 | | - - uses: docker/login-action@v3 |
81 | | - with: |
82 | | - username: ${{ secrets.DOCKER_LOGIN }} |
83 | | - password: ${{ secrets.DOCKER_PASSWORD }} |
84 | 80 | - uses: docker/login-action@v3 |
85 | 81 | with: |
86 | 82 | registry: ghcr.io |
|
94 | 90 | platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 |
95 | 91 | build-args: "APP_VERSION=${{ steps.slug.outputs.version }}" |
96 | 92 | tags: | |
97 | | - tarampampam/error-pages:latest |
98 | | - tarampampam/error-pages:${{ steps.slug.outputs.version }} |
99 | | - tarampampam/error-pages:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }} |
100 | | - tarampampam/error-pages:${{ steps.slug.outputs.version-major }} |
101 | 93 | ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest |
102 | 94 | ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }} |
103 | 95 | ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }} |
|
0 commit comments