Skip to content

Fix unit tests failing due to a license_finder update #307

Fix unit tests failing due to a license_finder update

Fix unit tests failing due to a license_finder update #307

name: Docker publish
on:
schedule:
- cron: '0 0 * * 0'
push:
branches:
- 'master'
tags:
- 'v*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get the latest non-prerelease
uses: rez0n/actions-github-release@main
id: latest-release
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
type: stable
- name: Choose Docker tag
id: chosen-tag
run: |
if [ ${{ github.event_name }} == 'schedule' ]; then
echo "tag=${{ steps.latest-release.outputs.release }}" >> $GITHUB_OUTPUT
else
echo "tag=${{github.ref_name}}" >> $GITHUB_OUTPUT
fi
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch,enable=${{github.event_name != 'schedule'}}
type=semver,enable=${{ steps.chosen-tag.outputs.tag != 'master' }},pattern=v{{version}},value=${{ steps.chosen-tag.outputs.tag }}
type=semver,enable=${{ steps.chosen-tag.outputs.tag != 'master' }},pattern=v{{major}},value=${{ steps.chosen-tag.outputs.tag }}
type=semver,enable=${{ steps.chosen-tag.outputs.tag != 'master' }},pattern=v{{major}}.{{minor}},value=${{ steps.chosen-tag.outputs.tag }}
- name: Build and export to Docker
id: build-and-export
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
load: true
tags: ${{ github.event.repository.name }}
labels: ${{ steps.meta.outputs.labels }}
- name: Test
run: docker run --env CI=true --name ${{ github.event.repository.name }} ${{ github.event.repository.name }} runner test
- name: Build and push
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}