-
Notifications
You must be signed in to change notification settings - Fork 666
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add frontend auto update workflow (#5501)
* Remove git submodule * Add frontend auto update workflow * Update .github/workflows/update_frontend.yml Co-authored-by: Stefan Agner <[email protected]> --------- Co-authored-by: Stefan Agner <[email protected]>
- Loading branch information
Showing
5 changed files
with
75 additions
and
32 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,74 @@ | ||
name: Update frontend | ||
|
||
on: | ||
schedule: # once a day | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
skip: ${{ steps.check_version.outputs.skip || steps.check_existing_pr.outputs.skip }} | ||
latest_tag: ${{ steps.latest_frontend_version.outputs.latest_tag }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Get latest frontend release | ||
id: latest_frontend_version | ||
uses: abatilo/[email protected] | ||
with: | ||
owner: home-assistant | ||
repo: frontend | ||
- name: Check if version is up to date | ||
id: check_version | ||
run: | | ||
SUPERVISOR_VERSION=$(cat .ha-frontend-version) | ||
LATEST_VERSION=${{ steps.latest_frontend_version.outputs.latest_tag }} | ||
echo "SUPERVISOR_VERSION=$SUPERVISOR_VERSION" >> $GITHUB_ENV | ||
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV | ||
if [[ ! "$SUPERVISOR_VERSION" < "$LATEST_VERSION" ]]; then | ||
echo "Frontend version is up to date" | ||
echo "skip=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Check if there is no open PR with this version | ||
if: steps.check_version.outputs.skip != 'true' | ||
id: check_existing_pr | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
PR=$(gh pr list --state open --base main --json title --search "Autoupdate frontend to version $LATEST_VERSION") | ||
if [[ "$PR" != "[]" ]]; then | ||
echo "Skipping - There is already a PR open for version $LATEST_VERSION" | ||
echo "skip=true" >> $GITHUB_OUTPUT | ||
fi | ||
create-pr: | ||
runs-on: ubuntu-latest | ||
needs: check-version | ||
if: needs.check-version.outputs.skip != 'true' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Clear www folder | ||
run: | | ||
rm -rf supervisor/api/panel/* | ||
- name: Update version file | ||
run: | | ||
echo "${{ needs.check-version.outputs.latest_tag }}" > .ha-frontend-version | ||
- name: Download release assets | ||
uses: robinraju/release-downloader@v1 | ||
with: | ||
repository: 'home-assistant/frontend' | ||
tag: ${{ needs.check-version.outputs.latest_tag }} | ||
fileName: home_assistant_frontend_supervisor-${{ needs.check-version.outputs.latest_tag }}.tar.gz | ||
extract: true | ||
out-file-path: supervisor/api/panel/ | ||
- name: Create PR | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
commit-message: "Autoupdate frontend to version ${{ needs.check-version.outputs.latest_tag }}" | ||
branch: autoupdate-frontend | ||
base: main | ||
draft: true | ||
sign-commits: true | ||
title: "Autoupdate frontend to version ${{ needs.check-version.outputs.latest_tag }}" |
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 @@ | ||
20241127.8 |
Submodule home-assistant-polymer
deleted from
46f0e0
This file was deleted.
Oops, something went wrong.