Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Sep 23, 2024
1 parent 07e7e75 commit ce9a53a
Show file tree
Hide file tree
Showing 14 changed files with 651 additions and 159 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/copyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@ on:
workflow_dispatch:

jobs:
update:
update-copyright:
runs-on: ubuntu-latest
steps:

- name: Get current year
id: date
run: echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT

- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_TOKEN }}

- name: Check Out Repo
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: develop

- name: Update Copyright
Expand All @@ -41,11 +49,11 @@ jobs:
if: failure()
with:
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
message: <@&1079153184007790652>
title: "${{ secrets.REPO_NAME }}: **Copyright Update Failed**"
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: 14879811
username: Kobota
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
author: GitHub
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/git.png
message: ${{ vars.BUILD_FAILURE_ROLE }}
title: "${{ vars.REPO_NAME }}: ${{ vars.TEXT_COPYRIGHT }}"
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.GIT_NAME }}
author_icon_url: ${{ vars.GIT_IMAGE }}
84 changes: 0 additions & 84 deletions .github/workflows/develop.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/docker-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Docker Develop Build

on:
push:
branches: [ develop ]

jobs:

docker-build-develop:
runs-on: ubuntu-latest
steps:

- name: Check Out Repo
uses: actions/checkout@v4
with:
ref: develop

- 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@v6
with:
context: ./
file: ./Dockerfile
build-args: |
"BRANCH_NAME=develop"
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ vars.DOCKER_TEAM }}/${{ vars.DOCKER_REPO }}:develop
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 }}
title: "${{ vars.NAME }} develop: ${{ vars.TEXT_SUCCESS }}"
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 }}
title: "${{ vars.NAME }} develop: ${{ vars.TEXT_FAILURE }}"
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 }}

commit-notification:
runs-on: ubuntu-latest
needs: [ docker-build-develop ]
if: ${{ success() }}
steps:

- name: Send Discord Commit Notification
uses: Kometa-Team/discord-notifications@master
with:
webhook_id_token: ${{ secrets.DEVELOP_WEBHOOK }}
title: Commits
message: "${{ vars.DEVELOP_ROLE }} - An update to ${{ vars.NAME }} has been published and is available to users of the **develop** branch."
commits: "true"
color: ${{ vars.COLOR_SUCCESS }}
username: ${{ vars.BOT_NAME }}
avatar_url: ${{ vars.BOT_IMAGE }}
author: ${{ vars.NAME }} Develop Release
author_icon_url: ${{ vars.RELEASE_IMAGE }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Docker Latest Release
name: Docker Latest Build

on:
push:
branches: [ master ]

jobs:

docker:
docker-build-latest:
runs-on: ubuntu-latest
steps:

Expand Down Expand Up @@ -34,33 +34,33 @@ jobs:
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: kometateam/${{ secrets.DOCKER_REPO }}:latest
tags: ${{ vars.DOCKER_TEAM }}/${{ vars.DOCKER_REPO }}:latest

- name: Discord Success Notification
uses: Kometa-Team/discord-notifications@master
if: success()
with:
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
title: "${{ secrets.REPO_NAME }} latest: **Build Successful**"
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: 844716
username: Kobota
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
author: Docker
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
title: "${{ vars.NAME }} latest: ${{ vars.TEXT_SUCCESS }}"
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: <@&1079153184007790652>
title: "${{ secrets.REPO_NAME }} latest: **Build Failed**"
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: 14879811
username: Kobota
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
author: Docker
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
message: ${{ vars.BUILD_FAILURE_ROLE }}
title: "${{ vars.NAME }} latest: ${{ vars.TEXT_FAILURE }}"
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 }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Version Release
name: Docker Version Build

on:
create:
Expand All @@ -7,9 +7,9 @@ on:

jobs:

docker:
docker-build-version:
if: ${{ startsWith(github.ref, 'refs/tags/v1') || startsWith(github.ref, 'refs/tags/v2') }}
runs-on: ubuntu-latest

steps:

- name: Check Out Repo
Expand Down Expand Up @@ -42,40 +42,42 @@ jobs:
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: kometateam/${{ secrets.DOCKER_REPO }}:${{ steps.get_version.outputs.VERSION }}
tags: ${{ vars.DOCKER_TEAM }}/${{ vars.DOCKER_REPO }}:${{ steps.get_version.outputs.VERSION }}
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 }}
title: "${{ secrets.REPO_NAME }} ${{ steps.get_version.outputs.VERSION }}: **Build Successful**"
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: 844716
username: Kobota
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
author: Docker
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
title: "${{ vars.NAME }} ${{ steps.get_version.outputs.VERSION }}: ${{ vars.TEXT_SUCCESS }}"
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: <@&1079153184007790652>
title: "${{ secrets.REPO_NAME }} ${{ steps.get_version.outputs.VERSION }}: **Build Failed**"
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: 14879811
username: Kobota
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
author: Docker
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
message: ${{ vars.BUILD_FAILURE_ROLE }}
title: "${{ vars.NAME }} ${{ steps.get_version.outputs.VERSION }}: ${{ vars.TEXT_FAILURE }}"
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 }}

- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
title: ${{ secrets.NAME }} ${{ github.event.ref }}
title: ${{ vars.NAME }} ${{ github.event.ref }}
repo_token: ${{ secrets.PAT }}
prerelease: false
Loading

0 comments on commit ce9a53a

Please sign in to comment.