ci: update workflows

This commit is contained in:
2025-02-21 00:55:21 -07:00
parent c77cb97946
commit 1607fb00ab
4 changed files with 188 additions and 29 deletions

View File

@@ -2,10 +2,12 @@
# @type github workflow
# @author Aetherinox
# @url https://github.com/Aetherinox
# @usage deploys docker container to Dockerhub
# @secrets secrets.ADMINSERV_GPG_KEY_ASC gpg private key (armored) | BEGIN PGP PRIVATE KEY BLOCK
# secrets.ADMINSERV_GPG_PASSPHRASE gpg private key passphrase
# secrets.IMAGE_DOCKERHUB_TOKEN hub.docker.com access token
# @usage deploys docker container to Dockerhub and send message to discord
# upload this workflow to both the `main` branch of the tvapp2 repository
# @secrets secrets.ADMINSERV_GPG_KEY_ASC gpg private key (armored) | BEGIN PGP PRIVATE KEY BLOCK
# secrets.ADMINSERV_GPG_PASSPHRASE gpg private key passphrase
# secrets.IMAGE_GHCR_TOKEN github personal access token (classic) with package:write permission
# secrets.DISCORD_WEBHOOK_CHAN_GITHUB_TVAPP2_RELEASES Discord webhook to report releases from github to discord
# #
name: "📦 Deploy Docker Dockerhub"
@@ -36,7 +38,7 @@ on:
IMAGE_NAME:
description: '📦 Image Name'
required: true
default: 'keeweb'
default: 'tvapp2'
type: string
# #
@@ -47,10 +49,10 @@ on:
# #
IMAGE_AUTHOR:
description: '🪪 Image Author'
required: true
default: 'antelle'
type: string
description: '🪪 Image Author'
required: true
default: 'TheBinaryNinja'
type: string
# #
# Image Version
@@ -59,10 +61,10 @@ on:
# #
IMAGE_VERSION:
description: '🏷️ Image Version'
required: true
default: '1.19.0'
type: string
description: '🏷️ Image Version'
required: true
default: '1.19.0'
type: string
# #
# Image Dockerhub username
@@ -73,7 +75,7 @@ on:
IMAGE_DOCKERHUB_USERNAME:
description: '🪪 Dockerhub Username'
required: true
default: 'antelle'
default: 'TheBinaryNinja'
type: string
# #
@@ -111,13 +113,13 @@ on:
# #
env:
IMAGE_NAME: ${{ github.event.inputs.IMAGE_NAME || 'keeweb' }}
IMAGE_AUTHOR: ${{ github.event.inputs.IMAGE_AUTHOR || 'antelle' }}
IMAGE_VERSION: ${{ github.event.inputs.IMAGE_VERSION || '1.19.0' }}
IMAGE_DOCKERHUB_USERNAME: ${{ github.event.inputs.IMAGE_DOCKERHUB_USERNAME || 'antelle' }}
IMAGE_NAME: ${{ github.event.inputs.IMAGE_NAME || 'tvapp2' }}
IMAGE_AUTHOR: ${{ github.event.inputs.IMAGE_AUTHOR || 'TheBinaryNinja' }}
IMAGE_VERSION: ${{ github.event.inputs.IMAGE_VERSION || '1.0.0' }}
IMAGE_DOCKERHUB_USERNAME: ${{ github.event.inputs.IMAGE_DOCKERHUB_USERNAME || 'TheBinaryNinja' }}
BOT_NAME_1: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]
# #
# Jobs
#
@@ -222,6 +224,18 @@ jobs:
run: |
echo "Starting Dockerhub arm64"
# #
# Release Dockerhub Get Timestamp
# #
- name: '🕛 Get Timestamp'
id: task_release_set_timestamp
run: |
echo "NOW=$(date +'%m-%d-%Y %H:%M:%S')" >> $GITHUB_ENV
echo "NOW_SHORT=$(date +'%m-%d-%Y')" >> $GITHUB_ENV
echo "NOW_LONG=$(date +'%m-%d-%Y %H:%M')" >> $GITHUB_ENV
echo "NOW_DOCKER_LABEL=$(date +'%Y%m%d')" >> $GITHUB_ENV
# #
# Release Dockerhub Checkout Arm64
# #
@@ -325,6 +339,13 @@ jobs:
type=ref,enable=${{ github.event_name == 'pull_request' || github.event_name == 'push' }},priority=600,prefix=,suffix=-arm64,event=tag
flavor: |
latest=false
labels: |
org.opencontainers.image.VERSION=${{ env.IMAGE_VERSION }}
org.opencontainers.image.BUILDDATE=${{ env.NOW_DOCKER_LABEL }}
org.opencontainers.image.licenses=MIT
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.vendor=${{ env.IMAGE_AUTHOR }}
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
# #
# Release Dockerhub Checkpoint Arm64
@@ -359,6 +380,65 @@ jobs:
tags: ${{ steps.task_release_dh_meta.outputs.tags }}
labels: ${{ steps.task_release_dh_meta.outputs.labels }}
# #
# Release Dockerhub Get Weekly Commits
# #
- name: '🕛 Get Weekly Commit List'
id: task_release_set_weekly_commit_list
run: |
echo 'WEEKLY_COMMITS<<EOF' >> $GITHUB_ENV
git log --format="[\`%h\`](${{ github.server_url }}/${{ github.repository }}/commit/%H) %s - %an" --since=7.days >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
# #
# Release Dockerhub Notify Github
# #
- name: '🔔 Send Discord Webhook Message'
id: task_release_notifications_discord_send
uses: tsickert/discord-webhook@v6.0.0
if: success()
with:
username: 'Io'
avatar-url: 'https://i.imgur.com/8BVDkla.jpg'
webhook-url: ${{ secrets.DISCORD_WEBHOOK_CHAN_GITHUB_TVAPP2_RELEASES }}
embed-title: "📦 **Deploy Docker Github Workflow Ran**"
embed-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
embed-thumbnail-url: 'https://i.imgur.com/zDIzE8T.jpg'
embed-description: |
## 📦 Docker Deploy ${{ job.status == 'success' && '✅' || '❌' }} `${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }}`
A new version of the docker container `${{ env.IMAGE_NAME }}` has been released from Github. The image is available at:
- https://github.com/${{ github.repository }}/pkgs/container/${{ env.IMAGE_NAME }}
- Docker Image: `${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }}`
- Version: `${{ env.IMAGE_VERSION }}`
- Pull URL: https://ghcr.io/${{ env.IMAGE_AUTHOR }}/${{ env.IMAGE_NAME }}
- Branch: `${{ github.ref_name }}`
- Workflow: `${{ github.workflow }} (#${{github.run_number}})`
- Triggered By: `${{ github.actor }}`
### Tags
-# This docker image will use the following tags:
```
${{ steps.task_release_dh_meta.outputs.tags }}
```
### Labels
-# This docker image embeds the following labels:
```
${{ steps.task_release_dh_meta.outputs.labels }}
```
embed-color: ${{ job.status == 'success' && '5763719' || '15418782' }}
embed-footer-text: "Completed at ${{ env.NOW }} UTC"
embed-timestamp: "${{ env.NOW_LONG }}"
embed-author-name: "${{ github.event.release.author.name }}"
embed-author-url: "${{ github.event.release.author.html_url }}"
embed-author-icon-url: "${{ github.event.release.author.avatar_url }}"
# #
# Job Docker Release Dockerhub Amd64
# #
@@ -384,6 +464,18 @@ jobs:
run: |
echo "Starting Dockerhub docker release"
# #
# Release Dockerhub Get Timestamp
# #
- name: '🕛 Get Timestamp'
id: task_release_set_timestamp
run: |
echo "NOW=$(date +'%m-%d-%Y %H:%M:%S')" >> $GITHUB_ENV
echo "NOW_SHORT=$(date +'%m-%d-%Y')" >> $GITHUB_ENV
echo "NOW_LONG=$(date +'%m-%d-%Y %H:%M')" >> $GITHUB_ENV
echo "NOW_DOCKER_LABEL=$(date +'%Y%m%d')" >> $GITHUB_ENV
# #
# Release Dockerhub Checkout Amd64
# #
@@ -411,7 +503,7 @@ jobs:
id: task_release_dh_dos2unix
run: |
find ./ \( -path "./.git" -o -path "./docs" -o -path "./.github" -o -path "*.png" -o -path "*.jpg" \) -prune -o -name '*' -print | xargs dos2unix --
# #
# Release Dockerhub Fix Permissions
# #
@@ -488,6 +580,13 @@ jobs:
type=raw,enable=${{ inputs.DEV_RELEASE }},priority=400,prefix=,suffix=,value=development
flavor: |
latest=${{ !inputs.DEV_RELEASE }}
labels: |
org.opencontainers.image.VERSION=${{ env.IMAGE_VERSION }}
org.opencontainers.image.BUILDDATE=${{ env.NOW_DOCKER_LABEL }}
org.opencontainers.image.licenses=MIT
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.vendor=${{ env.IMAGE_AUTHOR }}
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
# #
# Release Dockerhub Checkpoint Amd64
@@ -521,3 +620,62 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.task_release_dh_meta.outputs.tags }}
labels: ${{ steps.task_release_dh_meta.outputs.labels }}
# #
# Release Dockerhub Get Weekly Commits
# #
- name: '🕛 Get Weekly Commit List'
id: task_release_set_weekly_commit_list
run: |
echo 'WEEKLY_COMMITS<<EOF' >> $GITHUB_ENV
git log --format="[\`%h\`](${{ github.server_url }}/${{ github.repository }}/commit/%H) %s - %an" --since=7.days >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
# #
# Release Dockerhub Notify Github
# #
- name: '🔔 Send Discord Webhook Message'
uses: tsickert/discord-webhook@v6.0.0
if: success()
with:
username: 'Io'
avatar-url: 'https://i.imgur.com/8BVDkla.jpg'
webhook-url: ${{ secrets.DISCORD_WEBHOOK_CHAN_GITHUB_TVAPP2_RELEASES }}
embed-title: "📦 **Deploy Docker Github Workflow Ran**"
embed-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
embed-thumbnail-url: 'https://i.imgur.com/zDIzE8T.jpg'
embed-description: |
## 📦 Docker Deploy ${{ job.status == 'success' && '✅' || '❌' }} `${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }}`
A new version of the docker container `${{ env.IMAGE_NAME }}` has been released from Github. The image is available at:
- https://github.com/${{ github.repository }}/pkgs/container/${{ env.IMAGE_NAME }}
- Docker Image: `${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }}`
- Version: `${{ env.IMAGE_VERSION }}`
- Pull URL: https://ghcr.io/${{ env.IMAGE_AUTHOR }}/${{ env.IMAGE_NAME }}
- Branch: `${{ github.ref_name }}`
- Workflow: `${{ github.workflow }} (#${{github.run_number}})`
- Triggered By: `${{ github.actor }}`
### Tags
-# This docker image will use the following tags:
```
${{ steps.task_release_dh_meta.outputs.tags }}
```
### Labels
-# This docker image embeds the following labels:
```
${{ steps.task_release_dh_meta.outputs.labels }}
```
embed-color: ${{ job.status == 'success' && '5763719' || '15418782' }}
embed-footer-text: "Completed at ${{ env.NOW }} UTC"
embed-timestamp: "${{ env.NOW_LONG }}"
embed-author-name: "${{ github.event.release.author.name }}"
embed-author-url: "${{ github.event.release.author.html_url }}"
embed-author-icon-url: "${{ github.event.release.author.avatar_url }}"