Skip to content

Bump the all group across 1 directory with 10 updates #109

Bump the all group across 1 directory with 10 updates

Bump the all group across 1 directory with 10 updates #109

Workflow file for this run

on:
pull_request:
branches:
- main
push:
tags:
- "20*"
branches:
- main
paths:
- "**/*.rs"
- "addon/**"
- "**/Cargo.*"
- ".github/workflows/build.yml"
- ".cargo/config.toml"
- "Dockerfile"
- ".dockerignore"
env:
IMAGE_WITH_TLS: ghcr.io/wez/pview
IMAGE_NO_TLS: ghcr.io/wez/pview-no-tls
jobs:
build-tls:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_WITH_TLS }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }}
type=ref,event=tag,enable=${{ github.ref_type == 'tag' }}
type=ref,event=pr
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}
outputs: type=image,name=${{ env.IMAGE_WITH_TLS }},push-by-digest=true,name-canonical=true,push=true
build-no-tls:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v7
- linux/arm64
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Docker meta
if: ${{ github.event_name != 'pull_request' }}
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NO_TLS }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }}
type=ref,event=pr
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build No Push
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.notls
platforms: ${{ matrix.platform }}
push: false
- name: Build and push by digest
if: ${{ github.event_name != 'pull_request' }}
id: build
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.notls
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}
outputs: type=image,name=${{ env.IMAGE_NO_TLS }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
if: ${{ github.event_name != 'pull_request' }}
id: digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
echo "DIGEST_NAME=$(echo ${{ matrix.platform }} | sed 's,/,-,g')" >> $GITHUB_OUTPUT
- name: Upload digest
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: digest-${{ steps.digest.outputs.DIGEST_NAME }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge-no-tls:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
needs:
- build-no-tls
permissions:
contents: read
packages: write
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
pattern: digest-*
merge-multiple: true
path: /tmp/digests
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NO_TLS }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }}
type=ref,event=tag,enable=${{ github.ref_type == 'tag' }}
type=ref,event=pr
- name: Login to GHCR
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create \
${{ github.event_name == 'pull_request' && '--dry-run' || '' }} \
$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.IMAGE_NO_TLS }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.IMAGE_NO_TLS }}:${{ steps.meta.outputs.version }}
addon:
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- merge-no-tls
permissions:
contents: read
id-token: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Apply tag to version
run: ./scripts/apply-tag.sh
- name: Build and Publish Home Assistant Add On
uses: home-assistant/builder@master
with:
args: |
--all \
--cosign \
--target /data/addon