Skip to content

Commit e8484cb

Browse files
authored
Simplify deploy workflow by removing build-addon steps
Removed unnecessary steps for building the add-on and adjusted git add command.
1 parent 326a1b6 commit e8484cb

1 file changed

Lines changed: 3 additions & 72 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 3 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run: |
5353
git config user.name "github-actions[bot]"
5454
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
5656
if git diff --cached --quiet; then
5757
echo "No version change to commit."
5858
exit 0
@@ -122,76 +122,7 @@ jobs:
122122
cache-from: type=gha
123123
cache-to: type=gha,mode=max
124124

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
135125

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 }}
152126

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

Comments
 (0)