|
25 | 25 |
|
26 | 26 | - uses: actions/setup-node@v4 |
27 | 27 | with: |
28 | | - node-version-file: 'package.json' |
| 28 | + node-version-file: "package.json" |
29 | 29 |
|
30 | 30 | - run: npm ci |
31 | 31 |
|
@@ -59,25 +59,25 @@ jobs: |
59 | 59 | uses: docker/metadata-action@v5 |
60 | 60 | id: meta |
61 | 61 | with: |
62 | | - images: | |
63 | | - ghcr.io/nerivec/zigbee2mqtt-windfront |
64 | | - tags: | |
65 | | - type=semver,pattern={{version}} |
66 | | - type=semver,pattern={{major}}.{{minor}} |
67 | | - type=semver,pattern={{major}} |
| 62 | + images: | |
| 63 | + ghcr.io/nerivec/zigbee2mqtt-windfront |
| 64 | + tags: | |
| 65 | + type=semver,pattern={{version}} |
| 66 | + type=semver,pattern={{major}}.{{minor}} |
| 67 | + type=semver,pattern={{major}} |
68 | 68 |
|
69 | 69 | - name: Docker build and push |
70 | 70 | if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' |
71 | 71 | uses: docker/build-push-action@v6 |
72 | 72 | with: |
73 | | - context: . |
74 | | - file: Dockerfile |
75 | | - platforms: linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/riscv64,linux/386 |
76 | | - tags: ${{ steps.meta.outputs.tags }} |
77 | | - push: true |
78 | | - build-args: | |
79 | | - VERSION=${{ github.ref_name }} |
80 | | - DATE=${{ github.event.repository.updated_at }} |
| 73 | + context: . |
| 74 | + file: Dockerfile |
| 75 | + platforms: linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/riscv64,linux/386 |
| 76 | + tags: ${{ steps.meta.outputs.tags }} |
| 77 | + push: true |
| 78 | + build-args: | |
| 79 | + VERSION=${{ github.ref_name }} |
| 80 | + DATE=${{ github.event.repository.updated_at }} |
81 | 81 |
|
82 | 82 | - name: Add tarball dist to release assets |
83 | 83 | if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' |
|
87 | 87 | gh release upload ${{ github.ref_name }} zigbee2mqtt-windfront-${{ github.ref_name }}.tar.gz |
88 | 88 | env: |
89 | 89 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 90 | + |
| 91 | + - name: Publish built main branch |
| 92 | + if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
| 93 | + run: | |
| 94 | + temp_dir=$(mktemp -d) |
| 95 | + cp -R dist/. $temp_dir |
| 96 | + git switch --orphan built-main |
| 97 | + rm -rf ./* |
| 98 | + cp -R $temp_dir/* . |
| 99 | + git add -A |
| 100 | + git config --local user.name 'github-actions[bot]' |
| 101 | + git config --local user.email 'github-actions[bot]@users.noreply.github.com' |
| 102 | + git commit -m "$GITHUB_SHA" || echo 'Nothing to commit' |
| 103 | + git push --force --set-upstream origin built-main |
0 commit comments