mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-25 23:07:07 +03:00
easimon/maximize-build-space ran from a branch, and the lowercase and manifest actions ran from mutable tags, inside jobs that push images and mint build attestations. The release workflow also ran skopeo from its latest tag with the push credential mounted. The actions are now pinned to commit SHAs with version comments so Dependabot still bumps them, the lowercase action is replaced with ${GITHUB_REPOSITORY,,}, and skopeo is pinned by digest. ci.yml, release.yml, pull_request.yml and stale.yml now declare explicit token permissions instead of relying on the repository default.
57 lines
2.0 KiB
YAML
57 lines
2.0 KiB
YAML
name: 'Setup'
|
|
description: 'Set up QEMU and Buildx'
|
|
inputs:
|
|
GITHUB_TOKEN:
|
|
required: true
|
|
outputs:
|
|
image-repo:
|
|
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}
|
|
image-name:
|
|
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ steps.create-short-sha.outputs.SHORT_SHA }}
|
|
cache-name:
|
|
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
# Stop docker so we can mount more space at /var/lib/docker
|
|
- name: Stop docker
|
|
run: sudo systemctl stop docker
|
|
shell: bash
|
|
# This creates a virtual volume at /var/lib/docker to maximize the size
|
|
# As of 2/14/2024, this results in 97G for docker images
|
|
# Runners no longer have a separate /mnt disk, so the temp PV is also carved
|
|
# from root and temp-reserve-mb is what actually stays free on root. Keep 4G
|
|
# there for setup-qemu/buildx caches in ~/.docker and the tool cache
|
|
- name: Maximize build space
|
|
uses: easimon/maximize-build-space@fc881a613ad2a34aca9c9624518214ebc21dfc0c # v10
|
|
with:
|
|
root-reserve-mb: 8192
|
|
temp-reserve-mb: 4096
|
|
remove-dotnet: 'true'
|
|
remove-android: 'true'
|
|
remove-haskell: 'true'
|
|
remove-codeql: 'true'
|
|
build-mount-path: '/var/lib/docker'
|
|
- name: Start docker
|
|
run: sudo systemctl start docker
|
|
shell: bash
|
|
- id: lowercaseRepo
|
|
run: echo "lowercase=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v4
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ inputs.GITHUB_TOKEN }}
|
|
- name: Create version file
|
|
run: make version
|
|
shell: bash
|
|
- id: create-short-sha
|
|
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
|
|
shell: bash
|