forked from bmanojlovic/home-assistant-borg-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update project so it works on current versions of Home Assistant (#1)
- Loading branch information
Showing
13 changed files
with
229 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Configuration file for GitHub Dependabot | ||
|
||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
assignees: | ||
- "ceskyDJ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: ['v*'] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
name: Build and deploy add-on | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build add-on and publish it to GitHub Container Registry | ||
uses: home-assistant/[email protected] | ||
with: | ||
args: | | ||
--all \ | ||
--target . \ | ||
--docker-hub "ghcr.io/${{ github.repository_owner }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,35 +7,16 @@ on: | |
pull_request: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
find: | ||
name: Find add-ons | ||
runs-on: ubuntu-latest | ||
outputs: | ||
addons: ${{ steps.addons.outputs.addons_list }} | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
|
||
- name: 🔍 Find add-on directories | ||
id: addons | ||
uses: home-assistant/actions/helpers/find-addons@master | ||
|
||
lint: | ||
name: Lint add-on ${{ matrix.path }} | ||
name: Lint add-on config file | ||
runs-on: ubuntu-latest | ||
needs: find | ||
strategy: | ||
matrix: | ||
path: ${{ fromJson(needs.find.outputs.addons) }} | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3.5.0 | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🚀 Run Home Assistant Add-on Lint | ||
uses: frenck/action-addon-linter@v2.11 | ||
uses: frenck/action-addon-linter@v2.18.0 | ||
with: | ||
path: "./${{ matrix.path }}" | ||
path: "." |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# IDE files | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
ARG BUILD_FROM | ||
FROM $BUILD_FROM | ||
|
||
ENV LANG C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
|
||
RUN apk add --no-cache \ | ||
borgbackup \ | ||
openssh-keygen \ | ||
openssh-client | ||
openssh-client \ | ||
tar | ||
|
||
# Home Assistant CLI | ||
ARG BUILD_ARCH | ||
ARG CLI_VERSION | ||
RUN curl -Lso /usr/bin/ha \ | ||
"https://github.com/home-assistant/cli/releases/download/${CLI_VERSION}/ha_${BUILD_ARCH}" \ | ||
&& chmod a+x /usr/bin/ha | ||
RUN curl -Lso /usr/bin/ha "https://github.com/home-assistant/cli/releases/latest/download/ha_${BUILD_ARCH}" | ||
RUN chmod +x /usr/bin/ha | ||
|
||
# Copy required data for add-on | ||
COPY run.sh / | ||
RUN chmod a+x /run.sh | ||
RUN chmod +x /run.sh | ||
|
||
CMD [ "/run.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
SHELL=/bin/bash | ||
|
||
.PHONY: build run dev-deploy | ||
|
||
build: | ||
docker run \ | ||
--rm \ | ||
-it \ | ||
--name builder \ | ||
--privileged \ | ||
-v .:/data \ | ||
-v /var/run/docker.sock:/var/run/docker.sock:ro \ | ||
ghcr.io/home-assistant/amd64-builder \ | ||
-t /data \ | ||
--all \ | ||
--test \ | ||
-i home-assistant-borg-backup-dev \ | ||
-d local | ||
|
||
run: build | ||
docker run --rm -v ./data:/data local/home-assistant-borg-backup-dev | ||
|
||
dev-deploy: | ||
scp -r ../home-assistant-borg-backup steve:/addons |
Oops, something went wrong.