You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
3.2 KiB
97 lines
3.2 KiB
6 months ago
|
name: Validate Pull Request
|
||
|
|
||
6 months ago
|
on:
|
||
|
pull_request:
|
||
|
types: [opened, synchronize, reopened, labeled]
|
||
6 months ago
|
|
||
|
jobs:
|
||
6 months ago
|
|
||
6 months ago
|
validate-pull:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
|
||
|
- name: Display Refs
|
||
|
run: |
|
||
|
echo "Base Repo: ${{ github.event.pull_request.base.repo.full_name }}"
|
||
|
echo "Base Ref: ${{ github.base_ref }}"
|
||
|
echo "Head Repo: ${{ github.event.pull_request.head.repo.full_name }}"
|
||
|
echo "Head Ref: ${{ github.head_ref }}"
|
||
|
|
||
|
- name: Check Base Branch
|
||
|
if: github.base_ref == 'master' || github.base_ref == 'develop'
|
||
|
run: |
|
||
|
echo "ERROR: Pull Requests cannot be submitted to master or develop. Please submit the Pull Request to the nightly branch"
|
||
|
exit 1
|
||
|
|
||
|
- name: Checkout Repo
|
||
|
uses: actions/checkout@v4
|
||
|
|
||
|
- name: Run Spellcheck
|
||
6 months ago
|
uses: rojopolis/spellcheck-github-actions@0.36.0
|
||
|
|
||
6 months ago
|
docker-build-pull:
|
||
6 months ago
|
runs-on: ubuntu-latest
|
||
|
needs: [ validate-pull ]
|
||
6 months ago
|
if: contains(github.event.pull_request.labels.*.name, 'docker')
|
||
6 months ago
|
steps:
|
||
6 months ago
|
|
||
6 months ago
|
- name: Check Out Repo
|
||
|
uses: actions/checkout@v4
|
||
|
with:
|
||
|
ref: ${{ github.head_ref }}
|
||
|
|
||
|
- name: Login to Docker Hub
|
||
|
uses: docker/login-action@v3
|
||
|
with:
|
||
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||
|
|
||
|
- name: Set up QEMU
|
||
|
uses: docker/setup-qemu-action@master
|
||
|
with:
|
||
|
platforms: all
|
||
|
|
||
|
- name: Set up Docker Buildx
|
||
|
id: buildx
|
||
|
uses: docker/setup-buildx-action@v3
|
||
|
|
||
|
- name: Build and Push
|
||
|
id: docker_build
|
||
|
uses: docker/build-push-action@v5
|
||
|
with:
|
||
|
context: ./
|
||
|
file: ./Dockerfile
|
||
|
build-args: |
|
||
6 months ago
|
"BRANCH_NAME=${{ github.head_ref }}"
|
||
6 months ago
|
platforms: linux/amd64,linux/arm64
|
||
|
push: true
|
||
6 months ago
|
tags: kometateam/kometa:${{ github.head_ref }}
|
||
6 months ago
|
cache-from: type=gha
|
||
|
cache-to: type=gha,mode=max
|
||
|
|
||
|
- name: Discord Success Notification
|
||
|
uses: Kometa-Team/discord-notifications@master
|
||
|
if: success()
|
||
|
with:
|
||
|
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
|
||
6 months ago
|
title: "${{ vars.REPO_NAME }} ${{ github.head_ref }}: ${{ vars.TEXT_SUCCESS }}"
|
||
6 months ago
|
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
|
||
|
color: ${{ vars.COLOR_SUCCESS }}
|
||
|
username: ${{ vars.BOT_NAME }}
|
||
|
avatar_url: ${{ vars.BOT_IMAGE }}
|
||
|
author: ${{ vars.DOCKER_NAME }}
|
||
|
author_icon_url: ${{ vars.DOCKER_IMAGE }}
|
||
|
|
||
|
- name: Discord Failure Notification
|
||
|
uses: Kometa-Team/discord-notifications@master
|
||
|
if: failure()
|
||
|
with:
|
||
|
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
|
||
|
message: ${{ vars.BUILD_FAILURE_ROLE }}
|
||
6 months ago
|
title: "${{ vars.REPO_NAME }} ${{ github.head_ref }}: ${{ vars.TEXT_FAILURE }}"
|
||
6 months ago
|
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
|
||
|
color: ${{ vars.COLOR_FAILURE }}
|
||
|
username: ${{ vars.BOT_NAME }}
|
||
|
avatar_url: ${{ vars.BOT_IMAGE }}
|
||
|
author: ${{ vars.DOCKER_NAME }}
|
||
|
author_icon_url: ${{ vars.DOCKER_IMAGE }}
|