Skip to content

chore: use puppeteer chromium #13

chore: use puppeteer chromium

chore: use puppeteer chromium #13

name: Docker Build and Publish
on:
push:
branches: [ main ]
tags:
- 'v*.*.*'
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- type: normal
dockerfile: Dockerfile
image: ghcr.io/${{ github.repository }}
- type: hass
dockerfile: Dockerfile.hass
image: ghcr.io/${{ github.repository }}-hass
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
build-args: |
BUILD_FROM=homeassistant/amd64-base:latest
create-release:
needs: docker
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Generate addon config
run: |
echo "{ \"version\": \"${{ github.ref_name }}\" }" > config.json
cat config.yaml >> config.json
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./config.json
asset_name: config.json
asset_content_type: application/json