|
1 | | -name: Build |
| 1 | +name: "Build" |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
|
9 | 9 | release: |
10 | 10 | types: [published] |
11 | 11 |
|
12 | | -env: |
13 | | - REGISTRY: "ghcr.io" |
14 | | - |
15 | 12 | jobs: |
16 | 13 | build: |
17 | 14 | name: "Build" |
18 | 15 | runs-on: ubuntu-latest |
19 | | - timeout-minutes: 25 |
| 16 | + timeout-minutes: 15 |
| 17 | + |
| 18 | + permissions: |
| 19 | + contents: write |
| 20 | + packages: write |
20 | 21 |
|
21 | 22 | steps: |
22 | 23 | - name: "Checkout" |
23 | | - uses: actions/checkout@v4 |
| 24 | + uses: actions/checkout@v5 |
24 | 25 |
|
25 | | - - name: "Setup Buildx" |
26 | | - uses: docker/setup-buildx-action@v2 |
27 | | - with: |
28 | | - platforms: linux/amd64,linux/arm64 |
| 26 | + - name: "Debug CTX github" |
| 27 | + if: ${{ !github.event.act }} |
| 28 | + continue-on-error: true |
| 29 | + env: |
| 30 | + GITHUB_CTX: ${{ toJSON(github) }} |
| 31 | + run: echo "$GITHUB_CTX" |
29 | 32 |
|
30 | 33 | - name: "Docker Login" |
31 | | - uses: docker/login-action@v2 |
| 34 | + uses: docker/login-action@v3 |
32 | 35 | with: |
33 | | - registry: ${{ env.REGISTRY }} |
| 36 | + registry: ghcr.io |
34 | 37 | username: ${{ vars.GHCR_USER }} |
35 | 38 | password: ${{ secrets.GHCR_PASS }} |
36 | 39 |
|
37 | | - - name: "Generate Tags" |
| 40 | + - name: "Setup Buildx" |
| 41 | + uses: docker/setup-buildx-action@v3 |
| 42 | + with: |
| 43 | + platforms: linux/amd64,linux/arm64 |
| 44 | + |
| 45 | + - name: "Generate Version Tags" |
| 46 | + id: version |
| 47 | + uses: cssnr/update-version-tags-action@v1 |
| 48 | + with: |
| 49 | + prefix: "" |
| 50 | + release: true |
| 51 | + tags: ${{ inputs.tags }} |
| 52 | + |
| 53 | + - name: "Debug Version Tags" |
| 54 | + continue-on-error: true |
| 55 | + run: | |
| 56 | + echo "github.ref_name: ${{ github.ref_name }}" |
| 57 | + echo "inputs.tags: ${{ inputs.tags }}" |
| 58 | + echo "steps.version.outputs.tags: ${{ steps.version.outputs.tags }}" |
| 59 | +
|
| 60 | + - name: "Generate Docker Tags" |
38 | 61 | id: tags |
39 | | - uses: smashedr/docker-tags-action@master |
| 62 | + uses: cssnr/docker-tags-action@v1 |
40 | 63 | with: |
41 | | - images: "${{ env.REGISTRY }}/${{ github.repository }}" |
42 | | - extra: ${{ inputs.tags }} |
| 64 | + images: "ghcr.io/${{ github.repository }}" |
| 65 | + tags: ${{ steps.version.outputs.tags }} |
| 66 | + |
| 67 | + - name: "Debug Docker Tags" |
| 68 | + continue-on-error: true |
| 69 | + run: | |
| 70 | + echo "github.ref_name: ${{ github.ref_name }}" |
| 71 | + echo "tags: ${{ steps.tags.outputs.tags }}" |
| 72 | + echo "labels: ${{ steps.tags.outputs.labels }}" |
| 73 | + echo "annotations: ${{ steps.tags.outputs.annotations }}" |
| 74 | +
|
| 75 | + #- name: "Parse Nginx Version" |
| 76 | + # uses: madhead/semver-utils@latest |
| 77 | + # id: semver |
| 78 | + # with: |
| 79 | + # version: ${{ github.ref_name }} |
| 80 | + |
| 81 | + #- name: "Debug Nginx Version" |
| 82 | + # continue-on-error: true |
| 83 | + # run: | |
| 84 | + # echo "NGINX_VERSION: ${{ steps.semver.outputs.release }}" |
43 | 85 |
|
44 | 86 | - name: "Build and Push" |
45 | | - uses: docker/build-push-action@v4 |
| 87 | + uses: docker/build-push-action@v6 |
46 | 88 | with: |
47 | | - context: nginx |
48 | | - platforms: linux/amd64,linux/arm64 |
| 89 | + context: src |
49 | 90 | push: true |
| 91 | + platforms: linux/amd64,linux/arm64 |
50 | 92 | tags: ${{ steps.tags.outputs.tags }} |
| 93 | + labels: ${{ steps.tags.outputs.labels }} |
| 94 | + annotations: ${{ steps.tags.outputs.annotations }} |
| 95 | + #build-args: | |
| 96 | + # VERSION=${{ github.ref_name }} |
| 97 | + # NGINX_VERSION=${{ steps.semver.outputs.release }} |
| 98 | + |
| 99 | + - name: "Send Failure Notification" |
| 100 | + if: ${{ failure() }} |
| 101 | + uses: sarisia/actions-status-discord@v1 |
| 102 | + with: |
| 103 | + webhook: ${{ secrets.DISCORD_WEBHOOK }} |
0 commit comments