Skip to content

Commit

Permalink
Merge pull request #4 from hass-agent-beta/beta
Browse files Browse the repository at this point in the history
Initial merge of beta into main
  • Loading branch information
DrR0X-glitch authored Nov 15, 2023
2 parents 434d958 + 8e8e34d commit efe9a31
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 25 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/deploy-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Overwrite Beta Version
on:
push:
branches:
- beta
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
cache: "pip"
- run: pip install -r requirements.txt
- name: Fetch full gh-pages branch and create user
run: |
git fetch origin gh-pages --depth=1
git config user.name ci-bot
git config user.email ci-bot@example.com
- name: Get current beta version number
run: |
echo "version=$(mike list beta | awk -F'[()]' '{print $2}')" >> $GITHUB_ENV
- run: |
mike deploy -u -p ${{ env.version }} beta -t beta
27 changes: 27 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Overwrite Latest Version
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
cache: "pip"
- run: pip install -r requirements.txt
- name: Fetch full gh-pages branch and create user
run: |
git fetch origin gh-pages --depth=1
git config user.name ci-bot
git config user.email ci-bot@example.com
- name: Get current latest version number
run: |
echo "version=$(mike list latest | awk -F'[()]' '{print $2}')" >> $GITHUB_ENV
- run: |
mike deploy -u -p ${{ env.version }} latest -t latest
54 changes: 54 additions & 0 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release Beta Version
on:
workflow_dispatch:
inputs:
confirm_prs_resolved:
description: "I have made sure all PRs are resolved"
required: true
type: boolean
confirm_branch:
description: "I have set this workflow to run from the beta branch"
required: true
type: boolean
new_version:
description: "The new beta version number"
required: true
type: number
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
cache: "pip"
- run: pip install -r requirements.txt
- name: Fetch full gh-pages and main branches and create user
run: |
git fetch origin gh-pages --depth=1
git fetch origin main --depth=1
git config user.name ci-bot
git config user.email ci-bot@example.com
- name: Get version numbers
run: |
echo "beta_version=$(mike list beta | awk -F'[()]' '{print $2}')" >> $GITHUB_ENV
echo "latest_version=$(mike list latest | awk -F'[()]' '{print $2}')" >> $GITHUB_ENV
- name: Rename the current latest version to its version number
run: |
mike retitle -p ${{ env.latest_version }} ${{ env.latest_version }}
- name: Deploy current beta version as latest
run: |
mike deploy -p -u ${{ env.beta_version }} latest -t latest
- name: Deploy copy of beta with incremented version number for development
run: |
mike deploy -p -u ${{ inputs.new_version }} beta -t beta
- name: Merge beta branch with main
run: |
git fetch --unshallow
git checkout main
git pull
git merge --no-ff beta -m "Auto-Merge beta into main"
git push
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ theme:
logo: assets/images/logo/logo-128.png

plugins:
- mike:
canonical_version: latest
# - social:
# enabled: !ENV [CI, false]
# cards_layout: default/variant
Expand All @@ -61,6 +63,8 @@ extra_css:

# Add social icons to footer
extra:
version:
provider: mike
analytics:
provider: google
property: G-415530619
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdocs-material[imaging]==9.4.8
mike==2.0.0
7 changes: 7 additions & 0 deletions theme_override_home/main.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<!-- Elements added to main will be displayed on all pages -->
{% extends "base.html" %}

<!-- Outdated bar -->
{% block outdated %} You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}

<!-- Announcement bar -->
{% block announce %}

Expand Down

0 comments on commit efe9a31

Please sign in to comment.