|
52 | 52 | run: | |
53 | 53 | git config user.name "github-actions[bot]" |
54 | 54 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
55 | | - git add ha-addon/config.yaml server/package.json Dockerfile |
| 55 | + git add server/package.json Dockerfile |
56 | 56 | if git diff --cached --quiet; then |
57 | 57 | echo "No version change to commit." |
58 | 58 | exit 0 |
@@ -122,76 +122,7 @@ jobs: |
122 | 122 | cache-from: type=gha |
123 | 123 | cache-to: type=gha,mode=max |
124 | 124 |
|
125 | | - build-addon: |
126 | | - needs: [bump-version, build-app] |
127 | | - if: | |
128 | | - always() && |
129 | | - needs.build-app.result == 'success' && |
130 | | - (needs.bump-version.result == 'success' || needs.bump-version.result == 'skipped') |
131 | | - runs-on: ubuntu-latest |
132 | | - permissions: |
133 | | - contents: read |
134 | | - packages: write |
135 | 125 |
|
136 | | - strategy: |
137 | | - matrix: |
138 | | - arch: [amd64, aarch64, armv7] |
139 | | - include: |
140 | | - - arch: amd64 |
141 | | - platform: linux/amd64 |
142 | | - - arch: aarch64 |
143 | | - platform: linux/arm64 |
144 | | - - arch: armv7 |
145 | | - platform: linux/arm/v7 |
146 | | - |
147 | | - steps: |
148 | | - - name: Checkout repository |
149 | | - uses: actions/checkout@v4 |
150 | | - with: |
151 | | - ref: ${{ github.ref }} |
152 | 126 |
|
153 | | - - name: Set Docker image name (lowercase for GHCR) |
154 | | - run: echo "IMAGE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV |
155 | | - |
156 | | - - name: Resolve image version |
157 | | - id: ver |
158 | | - # Use bumped version from bump-version job; fall back to the version line in ha-addon/config.yaml. |
159 | | - # HA Supervisor pulls images at exactly this tag (matching ha-addon/config.yaml `version`). |
160 | | - run: | |
161 | | - v="${{ needs.bump-version.outputs.version }}" |
162 | | - if [ -z "$v" ]; then |
163 | | - v=$(awk -F'"' '/^version:/ {print $2; exit}' ha-addon/config.yaml) |
164 | | - fi |
165 | | - echo "version=$v" >> "$GITHUB_OUTPUT" |
166 | | - echo "Resolved version: $v" |
167 | | -
|
168 | | - - name: Log in to the Container registry |
169 | | - uses: docker/login-action@v3 |
170 | | - with: |
171 | | - registry: ${{ env.REGISTRY }} |
172 | | - username: ${{ github.actor }} |
173 | | - password: ${{ secrets.GITHUB_TOKEN }} |
174 | | - |
175 | | - - name: Set up QEMU |
176 | | - uses: docker/setup-qemu-action@v3 |
177 | | - |
178 | | - - name: Set up Docker Buildx |
179 | | - uses: docker/setup-buildx-action@v3 |
180 | | - |
181 | | - - name: Build and push Add-on image |
182 | | - uses: docker/build-push-action@v5 |
183 | | - with: |
184 | | - context: . |
185 | | - file: ./Dockerfile |
186 | | - push: true |
187 | | - platforms: ${{ matrix.platform }} |
188 | | - tags: | |
189 | | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-addon-${{ matrix.arch }}:${{ steps.ver.outputs.version }} |
190 | | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-addon-${{ matrix.arch }}:main |
191 | | - build-args: | |
192 | | - BUILD_FROM=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-app:${{ steps.ver.outputs.version }} |
193 | | - BUILD_VERSION=${{ steps.ver.outputs.version }} |
194 | | - VITE_APP_BUILD_VERSION=v${{ steps.ver.outputs.version }}@${{ github.sha }} |
195 | | - VITE_INSTALL_KIND=docker |
196 | | - cache-from: type=gha |
197 | | - cache-to: type=gha,mode=max |
| 127 | + |
| 128 | + |
0 commit comments