dev upload

This commit is contained in:
habuild 2022-08-13 12:38:00 +10:00
parent 6905772edd
commit 3d93f8863b
18 changed files with 1077 additions and 374 deletions

View file

@ -1,11 +1,12 @@
---
name: CI
# yamllint disable-line rule:truthy
# yamllint disable-line rule:true
on:
push:
branches:
- main
- dev
workflow_call:
inputs:
slug:
@ -51,7 +52,7 @@ jobs:
- name: 🚀 Run Add-on Lint
uses: frenck/action-addon-linter@v2.9.0
with:
community: true
community: false
path: "./${{ needs.information.outputs.target }}"
lint-hadolint:
@ -118,95 +119,4 @@ jobs:
with:
prettier_options: --write **/*.{json,js,md,yaml}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build ${{ matrix.architecture }}
needs:
- information
- lint-addon
- lint-hadolint
- lint-json
- lint-markdown
- lint-prettier
- lint-shellcheck
- lint-yamllint
runs-on: ubuntu-latest
strategy:
matrix:
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v3
- name: 🏗 Set up build cache
id: cache
uses: actions/cache@v3.0.6
with:
path: /tmp/.docker-cache
key: docker-${{ matrix.architecture }}-${{ github.sha }}
restore-keys: |
docker-${{ matrix.architecture }}
- name: 🏗 Set up QEMU
uses: docker/setup-qemu-action@v2.0.0
- name: 🏗 Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
- name: 🏗 Set up Codenotary Community Attestation Service (CAS)
uses: frenck/action-setup-cas@v0.1.0
- name: Compose build flags
id: flags
run: |
echo "::set-output name=date::$(date +"%Y-%m-%dT%H:%M:%SZ")"
from=$(yq --no-colors eval ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}")
echo "::set-output name=from::${from}"
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
echo "::set-output name=platform::linux/amd64"
elif [[ "${{ matrix.architecture }}" = "i386" ]]; then
echo "::set-output name=platform::linux/386"
elif [[ "${{ matrix.architecture }}" = "armhf" ]]; then
echo "::set-output name=platform::linux/arm/v6"
elif [[ "${{ matrix.architecture }}" = "armv7" ]]; then
echo "::set-output name=platform::linux/arm/v7"
elif [[ "${{ matrix.architecture }}" = "aarch64" ]]; then
echo "::set-output name=platform::linux/arm64/v8"
else
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
exit 1
fi
- name: ⤵️ Download base image
if: steps.flags.outputs.from != 'null'
run: docker pull "${{ steps.flags.outputs.from }}"
- name: ✅ Verify authenticity of base image
if: steps.flags.outputs.from != 'null' && needs.information.outputs.base_image_signer != 'null'
run: |
cas authenticate \
--signerID "${{ needs.information.outputs.base_image_signer }}" \
"docker://${{ steps.flags.outputs.from }}"
- name: 🚀 Build
uses: docker/build-push-action@v3.1.1
with:
push: false
context: ${{ needs.information.outputs.target }}
file: ${{ needs.information.outputs.target }}/Dockerfile
cache-from: |
type=local,src=/tmp/.docker-cache
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
cache-to: type=local,mode=max,dest=/tmp/.docker-cache-new
platforms: ${{ steps.flags.outputs.platform }}
build-args: |
BUILD_ARCH=${{ matrix.architecture }}
BUILD_DATE=${{ steps.flags.outputs.date }}
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
BUILD_FROM=${{ steps.flags.outputs.from }}
BUILD_NAME=${{ needs.information.outputs.name }}
BUILD_REF=${{ github.sha }}
BUILD_REPOSITORY=${{ github.repository }}
BUILD_VERSION=edge
# This ugly bit is necessary, or our cache will grow forever...
# Well until we hit GitHub's limit of 5GB :)
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: 🚚 Swap build cache
run: |
rm -rf /tmp/.docker-cache
mv /tmp/.docker-cache-new /tmp/.docker-cache
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -3,7 +3,7 @@ name: Builder
env:
# BUILD_ARGS: "--test"
MONITORED_FILES: "build.* config.* Dockerfile"
MONITORED_FILES: "config.*"
on:
push: