|
|
@ -27,49 +27,18 @@ jobs:
|
|
|
|
- name: Run Spellcheck
|
|
|
|
- name: Run Spellcheck
|
|
|
|
uses: rojopolis/spellcheck-github-actions@0.36.0
|
|
|
|
uses: rojopolis/spellcheck-github-actions@0.36.0
|
|
|
|
|
|
|
|
|
|
|
|
verify-changes:
|
|
|
|
docker-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [ validate-pull ]
|
|
|
|
needs: [ validate-pull ]
|
|
|
|
if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.base_ref == 'nightly' && startswith(github.head_ref, 'docker-')
|
|
|
|
if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.base_ref == 'nightly' && startswith(github.head_ref, 'docker-')
|
|
|
|
outputs:
|
|
|
|
|
|
|
|
build: ${{ steps.list-changes.outputs.build }}
|
|
|
|
|
|
|
|
tag: ${{ steps.create-tag.outputs.docker-tag }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create Tag
|
|
|
|
- name: Create Tag
|
|
|
|
id: create-tag
|
|
|
|
id: create-tag
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
var="${{ github.head_ref }}"
|
|
|
|
var="${{ github.head_ref }}"
|
|
|
|
echo "docker-tag=${var:7}" >> $GITHUB_OUTPUT
|
|
|
|
echo "docker-tag=${var:7}" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check Out Repo
|
|
|
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
ref: ${{ github.head_ref }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Get changes
|
|
|
|
|
|
|
|
id: get-changes
|
|
|
|
|
|
|
|
run: echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: List changed files
|
|
|
|
|
|
|
|
id: list-changes
|
|
|
|
|
|
|
|
run: |
|
|
|
|
|
|
|
|
for file in ${{ steps.get-changes.outputs.files }}; do
|
|
|
|
|
|
|
|
if [[ $file =~ ^(defaults|fonts|modules|kometa.py|requirements.txt|.dockerignore|Dockerfile).*$ ]] ; then
|
|
|
|
|
|
|
|
echo "$file will trigger docker build"
|
|
|
|
|
|
|
|
echo "build=true" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "$file will not trigger docker build"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker-build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: [ verify-changes ]
|
|
|
|
|
|
|
|
if: needs.verify-changes.outputs.build == 'true'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check Out Repo
|
|
|
|
- name: Check Out Repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
with:
|
|
|
@ -97,10 +66,10 @@ jobs:
|
|
|
|
context: ./
|
|
|
|
context: ./
|
|
|
|
file: ./Dockerfile
|
|
|
|
file: ./Dockerfile
|
|
|
|
build-args: |
|
|
|
|
build-args: |
|
|
|
|
"BRANCH_NAME=${{ needs.verify-changes.outputs.tag }}"
|
|
|
|
"BRANCH_NAME=${{ steps.create-tag.outputs.docker-tag }}"
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
push: true
|
|
|
|
tags: kometateam/kometa:${{ needs.verify-changes.outputs.tag }}
|
|
|
|
tags: kometateam/kometa:${{ steps.create-tag.outputs.docker-tag }}
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
|
|
|
cache-to: type=gha,mode=max
|
|
|
|
|
|
|
|
|
|
|
@ -109,7 +78,7 @@ jobs:
|
|
|
|
if: success()
|
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
|
|
|
|
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
|
|
|
|
title: "${{ vars.REPO_NAME }} ${{ needs.verify-changes.outputs.tag }}: ${{ vars.TEXT_SUCCESS }}"
|
|
|
|
title: "${{ vars.REPO_NAME }} ${{ steps.create-tag.outputs.docker-tag }}: ${{ vars.TEXT_SUCCESS }}"
|
|
|
|
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
|
|
|
|
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
|
|
|
|
color: ${{ vars.COLOR_SUCCESS }}
|
|
|
|
color: ${{ vars.COLOR_SUCCESS }}
|
|
|
|
username: ${{ vars.BOT_NAME }}
|
|
|
|
username: ${{ vars.BOT_NAME }}
|
|
|
@ -123,7 +92,7 @@ jobs:
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
|
|
|
|
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
|
|
|
|
message: ${{ vars.BUILD_FAILURE_ROLE }}
|
|
|
|
message: ${{ vars.BUILD_FAILURE_ROLE }}
|
|
|
|
title: "${{ vars.REPO_NAME }} ${{ needs.verify-changes.outputs.tag }}: ${{ vars.TEXT_FAILURE }}"
|
|
|
|
title: "${{ vars.REPO_NAME }} ${{ steps.create-tag.outputs.docker-tag }}: ${{ vars.TEXT_FAILURE }}"
|
|
|
|
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
|
|
|
|
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
|
|
|
|
color: ${{ vars.COLOR_FAILURE }}
|
|
|
|
color: ${{ vars.COLOR_FAILURE }}
|
|
|
|
username: ${{ vars.BOT_NAME }}
|
|
|
|
username: ${{ vars.BOT_NAME }}
|
|
|
|