This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
Bump markdown from 3.4.3 to 3.5 in /mkdocs #467
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
name: Continuous integration and deployment | |
on: | |
push: | |
# Sequence of patterns matched against refs/heads | |
branches: [master] | |
# Sequence of patterns matched against refs/tags | |
tags: [v*] | |
pull_request: | |
branches: [master] | |
jobs: | |
lint: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
test: | |
needs: lint | |
name: Test code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Test docker build | |
run: | | |
docker run --rm --privileged \ | |
-v ~/.docker:/root/.docker \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v "$(pwd)":/data homeassistant/amd64-builder \ | |
--target mkdocs --amd64 --test | |
build: | |
needs: test | |
name: Build image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build and push latest Docker image | |
if: github.event_name == 'push' | |
run: | | |
sed -i "s/dev/latest/g" mkdocs/config.json | |
docker run --rm --privileged \ | |
-v ~/.docker:/root/.docker \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v "$(pwd)":/data homeassistant/amd64-builder \ | |
--target mkdocs --all \ | |
--docker-user ${{ secrets.DOCKER_USERNAME }} \ | |
--docker-password ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push tagged Docker image | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
ADDON_VERSION=$( cut -c12- <<< ${{ github.ref }} ) | |
sed -i "s/latest/$ADDON_VERSION/g" mkdocs/config.json | |
docker run --rm --privileged \ | |
-v ~/.docker:/root/.docker \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v "$(pwd)":/data homeassistant/amd64-builder \ | |
--target mkdocs --all \ | |
--docker-user ${{ secrets.DOCKER_USERNAME }} \ | |
--docker-password ${{ secrets.DOCKER_PASSWORD }} | |
publish: | |
needs: build | |
name: Publish release | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Checkout add-on code | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
path: addon | |
- name: Checkout repository code | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
repository: filii-lamberti/repository | |
path: repository | |
- name: Create local changes and commit files | |
continue-on-error: true | |
run: | | |
ADDON_NAME=$( cut -c22- <<< ${{ github.repository }} ) | |
ADDON_VERSION=$( cut -c12- <<< ${{ github.ref }} ) | |
cp -v addon/README.md addon/mkdocs/config.json repository/mkdocs/ | |
cd repository | |
sed -i "s/dev/$ADDON_VERSION/g" mkdocs/config.json | |
git config --local user.email "[email protected]" | |
git config --local user.name "Filii Lamberti" | |
git add . | |
git commit -m "Upgrade $ADDON_NAME to v$ADDON_VERSION" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
directory: repository | |
repository: filii-lamberti/repository |