Compare commits
1 Commits
master
...
3e6689bd20
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e6689bd20 |
@@ -1,9 +1,15 @@
|
|||||||
---
|
---
|
||||||
name: build
|
name: publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
sha:
|
||||||
|
description: Commit SHA to promote (defaults to dispatch SHA)
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -18,7 +24,7 @@ jobs:
|
|||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: quay.io/podman/stable:v5.4
|
image: quay.io/podman/stable:v5.6
|
||||||
options: >-
|
options: >-
|
||||||
--privileged
|
--privileged
|
||||||
--security-opt seccomp=unconfined
|
--security-opt seccomp=unconfined
|
||||||
@@ -95,3 +101,76 @@ jobs:
|
|||||||
--form-string "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
--form-string "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
-F "message=Workflow failed on ${{ github.repository }}" \
|
-F "message=Workflow failed on ${{ github.repository }}" \
|
||||||
https://api.pushover.net/1/messages.json
|
https://api.pushover.net/1/messages.json
|
||||||
|
|
||||||
|
promote-and-deploy:
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: quay.io/podman/stable:v5.6
|
||||||
|
options: >-
|
||||||
|
--privileged
|
||||||
|
--security-opt seccomp=unconfined
|
||||||
|
--device /dev/fuse
|
||||||
|
--user root
|
||||||
|
env:
|
||||||
|
CONTAINERS_STORAGE_DRIVER: vfs
|
||||||
|
BUILDAH_FORMAT: docker
|
||||||
|
XDG_RUNTIME_DIR: /tmp/run
|
||||||
|
SHA_INPUT: ${{ inputs.sha }}
|
||||||
|
steps:
|
||||||
|
- name: Podman login
|
||||||
|
env:
|
||||||
|
REGISTRY_USERNAME: ${{ secrets.dockerhub_username }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.dockerhub_password }}
|
||||||
|
run: |
|
||||||
|
mkdir -p /var/lib/containers "$XDG_RUNTIME_DIR"
|
||||||
|
echo -n "$REGISTRY_PASSWORD" | podman login --username "$REGISTRY_USERNAME" --password-stdin "$REGISTRY_SERVER"
|
||||||
|
- name: Promote latest from SHA
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
SHA_TO_PROMOTE=${SHA_INPUT:-${GITHUB_SHA}}
|
||||||
|
echo "== Promoting ${RELEASE_IMAGE_NAME}:${SHA_TO_PROMOTE} into production"
|
||||||
|
podman pull "docker://${RELEASE_IMAGE_NAME}:${SHA_TO_PROMOTE}"
|
||||||
|
podman push "${RELEASE_IMAGE_NAME}:${SHA_TO_PROMOTE}" "docker://${RELEASE_IMAGE_NAME}:latest"
|
||||||
|
- name: Logout
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
podman logout "${REGISTRY_SERVER}"
|
||||||
|
- name: Notify via Pushover on failure
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
curl -v \
|
||||||
|
-F "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
||||||
|
-F "user=${{ secrets.PUSHOVER_USER }}" \
|
||||||
|
--form-string "title=HomeAssistant Promote Failed" \
|
||||||
|
--form-string "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
|
-F "message=Workflow failed on ${{ github.repository }}" \
|
||||||
|
https://api.pushover.net/1/messages.json
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
runs-on: docker
|
||||||
|
needs: promote-and-deploy
|
||||||
|
container:
|
||||||
|
image: bitnami/kubectl:1.32
|
||||||
|
steps:
|
||||||
|
- name: Write kubeconfig
|
||||||
|
env:
|
||||||
|
KUBECONFIG_CONTENT: ${{ secrets.kubeconfig }}
|
||||||
|
run: |
|
||||||
|
echo "$KUBECONFIG_CONTENT" > kubeconfig
|
||||||
|
- name: Rollout restart
|
||||||
|
run: |
|
||||||
|
kubectl --kubeconfig=kubeconfig -n ${KUBERNETES_NAMESPACE} rollout restart deployment/hass
|
||||||
|
kubectl --kubeconfig=kubeconfig -n ${KUBERNETES_NAMESPACE} rollout status deployment/hass
|
||||||
|
- name: Notify via Pushover on failure
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
curl -v \
|
||||||
|
-F "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
||||||
|
-F "user=${{ secrets.PUSHOVER_USER }}" \
|
||||||
|
--form-string "title=HomeAssistant Deploy Failed" \
|
||||||
|
--form-string "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
|
-F "message=Workflow failed on ${{ github.repository }}" \
|
||||||
|
https://api.pushover.net/1/messages.json
|
||||||
|
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
---
|
|
||||||
name: deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
sha:
|
|
||||||
description: Commit SHA to promote (defaults to dispatch SHA)
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY_SERVER: docker.io
|
|
||||||
RELEASE_IMAGE_NAME: docker.io/genunix/homeassistant
|
|
||||||
KUBERNETES_NAMESPACE: hass
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
promote-and-deploy:
|
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: quay.io/podman/stable:v5.4
|
|
||||||
options: >-
|
|
||||||
--privileged
|
|
||||||
--security-opt seccomp=unconfined
|
|
||||||
--device /dev/fuse
|
|
||||||
--user root
|
|
||||||
env:
|
|
||||||
CONTAINERS_STORAGE_DRIVER: vfs
|
|
||||||
BUILDAH_FORMAT: docker
|
|
||||||
XDG_RUNTIME_DIR: /tmp/run
|
|
||||||
SHA_INPUT: ${{ inputs.sha }}
|
|
||||||
steps:
|
|
||||||
- name: Podman login
|
|
||||||
env:
|
|
||||||
REGISTRY_USERNAME: ${{ secrets.dockerhub_username }}
|
|
||||||
REGISTRY_PASSWORD: ${{ secrets.dockerhub_password }}
|
|
||||||
run: |
|
|
||||||
mkdir -p /var/lib/containers "$XDG_RUNTIME_DIR"
|
|
||||||
echo -n "$REGISTRY_PASSWORD" | podman login --username "$REGISTRY_USERNAME" --password-stdin "$REGISTRY_SERVER"
|
|
||||||
- name: Promote latest from SHA
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
SHA_TO_PROMOTE=${SHA_INPUT:-${GITHUB_SHA}}
|
|
||||||
echo "== Promoting ${RELEASE_IMAGE_NAME}:${SHA_TO_PROMOTE} into production"
|
|
||||||
podman pull "docker://${RELEASE_IMAGE_NAME}:${SHA_TO_PROMOTE}"
|
|
||||||
podman push "${RELEASE_IMAGE_NAME}:${SHA_TO_PROMOTE}" "docker://${RELEASE_IMAGE_NAME}:latest"
|
|
||||||
- name: Logout
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
podman logout "${REGISTRY_SERVER}"
|
|
||||||
- name: Notify via Pushover on failure
|
|
||||||
if: failure()
|
|
||||||
run: |
|
|
||||||
curl -v \
|
|
||||||
-F "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
|
||||||
-F "user=${{ secrets.PUSHOVER_USER }}" \
|
|
||||||
--form-string "title=HomeAssistant Promote Failed" \
|
|
||||||
--form-string "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
|
||||||
-F "message=Workflow failed on ${{ github.repository }}" \
|
|
||||||
https://api.pushover.net/1/messages.json
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
runs-on: docker
|
|
||||||
needs: promote-and-deploy
|
|
||||||
container:
|
|
||||||
image: bitnami/kubectl
|
|
||||||
steps:
|
|
||||||
- name: Write kubeconfig
|
|
||||||
env:
|
|
||||||
KUBECONFIG_CONTENT: ${{ secrets.kubeconfig }}
|
|
||||||
run: |
|
|
||||||
echo "$KUBECONFIG_CONTENT" > kubeconfig
|
|
||||||
- name: Rollout restart
|
|
||||||
run: |
|
|
||||||
kubectl --kubeconfig=kubeconfig -n ${KUBERNETES_NAMESPACE} rollout restart deployment/hass
|
|
||||||
kubectl --kubeconfig=kubeconfig -n ${KUBERNETES_NAMESPACE} rollout status deployment/hass
|
|
||||||
- name: Notify via Pushover on failure
|
|
||||||
if: failure()
|
|
||||||
run: |
|
|
||||||
curl -v \
|
|
||||||
-F "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
|
||||||
-F "user=${{ secrets.PUSHOVER_USER }}" \
|
|
||||||
--form-string "title=HomeAssistant Deploy Failed" \
|
|
||||||
--form-string "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
|
||||||
-F "message=Workflow failed on ${{ github.repository }}" \
|
|
||||||
https://api.pushover.net/1/messages.json
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/homeassistant/home-assistant:2025.11.2
|
FROM docker.io/homeassistant/home-assistant:2025.8.3
|
||||||
|
|
||||||
#COPY src/ /usr/src/homeassistant/homeassistant/
|
#COPY src/ /usr/src/homeassistant/homeassistant/
|
||||||
|
|
||||||
@@ -10,9 +10,6 @@ RUN mkdir -p /usr/local/config/custom_components && \
|
|||||||
wget -q -O - https://install.hacs.xyz | bash - && \
|
wget -q -O - https://install.hacs.xyz | bash - && \
|
||||||
cat /usr/local/config/custom_components/hacs/manifest.json | jq -r .requirements[] | xargs /usr/local/bin/python3 -m pip install --quiet --no-cache-dir --upgrade --constraint /usr/src/homeassistant/homeassistant/package_constraints.txt --find-links https://wheels.home-assistant.io/musllinux/ --prefer-binary
|
cat /usr/local/config/custom_components/hacs/manifest.json | jq -r .requirements[] | xargs /usr/local/bin/python3 -m pip install --quiet --no-cache-dir --upgrade --constraint /usr/src/homeassistant/homeassistant/package_constraints.txt --find-links https://wheels.home-assistant.io/musllinux/ --prefer-binary
|
||||||
|
|
||||||
# NOTE: Fix https://github.com/home-assistant/core/pull/155885
|
|
||||||
RUN sed -i 's/args, unknown = parser.parse_known_args(script_args)/args, unknown = parser.parse_known_args()/g' /usr/src/homeassistant/homeassistant/scripts/check_config.py
|
|
||||||
|
|
||||||
ADD entrypoint.sh /entrypoint.sh
|
ADD entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
ENV PYTHONUSERBASE /config/deps
|
ENV PYTHONUSERBASE /config/deps
|
||||||
|
|||||||
Reference in New Issue
Block a user