Skip to content

Build Tool - Tester #94

Build Tool - Tester

Build Tool - Tester #94

Workflow file for this run

name: Build Tool - Tester
on:
workflow_dispatch:
env:
TAG: templatetester
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-tool:
name: Build Tool
runs-on: ubuntu-20.04
permissions:
contents: write
packages: write
strategy:
matrix:
platform: [ "linux/amd64" ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: type=raw,${{ env.TAG }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: Dockerfile-${{ env.TAG }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
sha: ${{ github.sha }}
version: ${{ env.VERSION }}
platforms: ${{ matrix.platform }}
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: "pufferpanel/templates"
path: templates
- name: Get templates
run: |
cd templates
FILES=$(ls -d */ | cut -f1 -d '/' | awk '{print "\""$0"\""}' | tr '\n' ',' | sed 's/,$/\n/')
echo "TEMPLATES=$FILES" >> $GITHUB_ENV
- name: Trigger tests
id: trigger
uses: peter-evans/repository-dispatch@v2
with:
event-type: template-tester
client-payload: '{ "templates": [ ${{ env.TEMPLATES }} ] }'