📦 Deploy › Docker › Dockerhub #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # # | |
| # @type github workflow | |
| # @author Aetherinox | |
| # @url https://github.com/Aetherinox | |
| # @usage deploys docker container to Dockerhub and send message to discord | |
| # upload this workflow to the following branches: | |
| # - https://github.com/Aetherinox/docker-base-ubuntu/tree/main | |
| # - https://github.com/Aetherinox/docker-base-ubuntu/tree/docker/ubuntu-* | |
| # | |
| # @secrets secrets.SELF_TOKEN self github personal access token (fine-grained) | |
| # secrets.SELF_TOKEN_CL self github personal access token (classic) | |
| # secrets.NPM_TOKEN self npmjs access token | |
| # secrets.PYPI_API_TOKEN self Pypi API token (production site) - https://pypi.org/ | |
| # secrets.PYPI_API_TEST_TOKEN self Pypi API token (test site) - https://test.pypi.org/ | |
| # secrets.SELF_DOCKERHUB_TOKEN self Dockerhub token | |
| # secrets.CODECOV_TOKEN codecov upload token for nodejs projects | |
| # secrets.MAXMIND_GELITE_TOKEN maxmind API token | |
| # secrets.CF_ACCOUNT_ID cloudflare account id | |
| # secrets.CF_ACCOUNT_TOKEN cloudflare account token | |
| # secrets.ORG_TOKEN org github personal access token (fine-grained) | |
| # secrets.ORG_TOKEN_CL org github personal access token (classic) | |
| # secrets.ORG_DOCKERHUB_TOKEN org dockerhub secret | |
| # secrets.ORG_GITEA_TOKEN org gitea personal access token (classic) with package:write permission | |
| # secrets.BOT_GPG_KEY_ASC bot gpg private key (armored) | BEGIN PGP PRIVATE KEY BLOCK | |
| # secrets.BOT_GPG_KEY_B64 bot gpg private key (binary) converted to base64 | |
| # secrets.BOT_GPG_PASSPHRASE bot gpg private key passphrase | |
| # secrets.DISCORD_WEBHOOK_CHAN_GITHUB_RELEASES discord webhook to report release notifications from github to discord | |
| # secrets.DISCORD_WEBHOOK_CHAN_GITHUB_WORKFLOWS discord webhook to report workflow notifications from github to discord | |
| # secrets.DISCORD_WEBHOOK_CHAN_GITHUB_UPDATES discord webhook to report activity notifications from github to discord | |
| # | |
| # @local these workflows can be tested locally through the use of `act` | |
| # https://github.com/nektos/act | |
| # Extract act to folder | |
| # Add system env var with path to act.exe | |
| # Run the commands: | |
| # git pull https://github.com/username/repo | |
| # act -W .github/workflows/deploy-docker-dockerhub.yml -P ubuntu-latest=catthehacker/ubuntu:full-22.04 | |
| # act -W .github/workflows/deploy-docker-dockerhub.yml -s TOKEN_CL=XXXXXXXXXX --pull=false | |
| # # | |
| name: '📦 Deploy › Docker › Dockerhub' | |
| run-name: '📦 Deploy › Docker › Dockerhub' | |
| # # | |
| # Triggers | |
| # # | |
| on: | |
| # # | |
| # Trigger › Workflow Dispatch | |
| # | |
| # If any values are not provided, will use fallback env variable | |
| # # | |
| workflow_dispatch: | |
| inputs: | |
| # # | |
| # Dockerhub › Image Name | |
| # | |
| # name of release; ubuntu, alpine, etc | |
| # # | |
| IMAGE_NAME: | |
| description: '📦 Image Name' | |
| required: true | |
| default: 'ubuntu' | |
| type: string | |
| # # | |
| # Dockerhub › Distro Name | |
| # | |
| # used in github image path | |
| # ghcr.io/${{ env.IMAGE_DOCKERHUB_AUTHOR }}/${{ env.IMAGE_DISTRO }} | |
| # # | |
| IMAGE_DISTRO: | |
| description: '📦 Distro Name' | |
| required: true | |
| default: 'noble' | |
| type: string | |
| # # | |
| # Dockerhub › Image Version | |
| # | |
| # used to create new release tag, and add version to docker image name | |
| # # | |
| IMAGE_VERSION: | |
| description: '🏷️ Image Version' | |
| required: true | |
| default: '24.04' | |
| type: string | |
| # # | |
| # Dockerhub › Image Registry | |
| # | |
| # Options: | |
| # - github | |
| # - dockerhub | |
| # - gitea | |
| # - local | |
| # # | |
| IMAGE_REGISTRY: | |
| description: '📕 Image Registry' | |
| required: true | |
| default: 'Dockerhub' | |
| type: choice | |
| options: | |
| - Dockerhub | |
| - Gitea | |
| - Github | |
| - Local | |
| # # | |
| # Dockerhub › Author | |
| # | |
| # used in dockerhub image path | |
| # hub.docker.com/r/${{ env.IMAGE_DOCKERHUB_AUTHOR }}/${{ env.IMAGE_NAME }} | |
| # # | |
| IMAGE_DOCKERHUB_AUTHOR: | |
| description: '🪪 Image Author' | |
| required: true | |
| default: 'aetherinox' | |
| type: string | |
| # # | |
| # Dockerhub › Username | |
| # | |
| # this is the user to sign into Dockerhub as. | |
| # this username MUST be lowercase or you will get `unauthorized: incorrect username or password` | |
| # # | |
| IMAGE_DOCKERHUB_USERNAME: | |
| description: '🪪 Dockerhub Username' | |
| required: true | |
| default: 'aetherinox' | |
| type: string | |
| # # | |
| # true no changes to the repo will be made | |
| # false workflow will behave normally, and push any changes detected to the files | |
| # # | |
| DRY_RUN: | |
| description: '🐛 Dry Run (Debug)' | |
| required: true | |
| default: false | |
| type: boolean | |
| # # | |
| # true released version will be marked as a development build and will have the v1.x.x-development tag instead of -latest | |
| # false release version will be marked with -latest docker tag | |
| # # | |
| DEV_RELEASE: | |
| description: '🧪 Development Release' | |
| required: true | |
| default: false | |
| type: boolean | |
| # # | |
| # Trigger › Push | |
| # # | |
| push: | |
| tags: | |
| - '*' | |
| # # | |
| # Environment Vars | |
| # # | |
| env: | |
| IMAGE_NAME: ${{ github.event.inputs.IMAGE_NAME || 'ubuntu' }} | |
| IMAGE_DISTRO: ${{ github.event.inputs.IMAGE_DISTRO || 'noble' }} | |
| IMAGE_VERSION: ${{ github.event.inputs.IMAGE_VERSION || '24.04' }} | |
| IMAGE_DOCKERHUB_AUTHOR: ${{ github.event.inputs.IMAGE_DOCKERHUB_AUTHOR || 'aetherinox' }} | |
| IMAGE_DOCKERHUB_USERNAME: ${{ github.event.inputs.IMAGE_DOCKERHUB_USERNAME || 'aetherinox' }} | |
| IMAGE_REGISTRY: ${{ github.event.inputs.IMAGE_REGISTRY || 'Dockerhub' }} | |
| DISCORD_BOT_NAME: 'Europa' | |
| DISCORD_BOT_AVATAR: 'https://i.imgur.com/UqwMom1.jpeg' | |
| DISCORD_BOT_EMBED_AUTHOR_ICON: 'https://avatars.githubusercontent.com/u/200161462' | |
| DISCORD_BOT_EMBED_THUMBNAIL: 'https://avatars.githubusercontent.com/u/200161462' | |
| BOT_NAME_1: EuropaServ | |
| BOT_NAME_2: BinaryServ | |
| BOT_NAME_DEPENDABOT: dependabot[bot] | |
| BOT_NAME_RENOVATE: renovate[bot] | |
| # # | |
| # Jobs | |
| # | |
| # The way pushed docker containers on Dockerhub work, the most recent image built goes at the top. | |
| # We will use the order below which builds the :latest image last so that it appears at the very | |
| # top of the packages page. | |
| # # | |
| jobs: | |
| # # | |
| # Job › Create Tag | |
| # # | |
| job-docker-release-tags-create: | |
| name: >- | |
| 📦 Release › Create Tag | |
| runs-on: ubuntu-latest | |
| # runs-on: apollo-x64 | |
| timeout-minutes: 4 | |
| permissions: | |
| contents: write | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| # # | |
| # Release › Tags › Checkout | |
| # # | |
| - name: '☑️ Checkout' | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # # | |
| # Release › Tags › Job Information | |
| # # | |
| - name: >- | |
| 🔄 Load Job | |
| uses: qoomon/actions--context@v4 | |
| id: 'context' | |
| # # | |
| # Release › Tags › Start | |
| # # | |
| - name: >- | |
| ✅ Start | |
| run: | | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo " Starting Job ${{ steps.context.outputs.job_name }}" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| YEAR="$(date +'%Y')" | |
| echo "YEAR=${YEAR}" >> $GITHUB_ENV | |
| NOW="$(date +'%m-%d-%Y %H:%M:%S')" # 02-25-2025 12:49:48 | |
| echo "NOW=${NOW}" >> $GITHUB_ENV | |
| NOW_SHORT="$(date +'%m-%d-%Y')" # 02-25-2025 | |
| echo "NOW_SHORT=${NOW_SHORT}" >> $GITHUB_ENV | |
| NOW_LONG="$(date +'%m-%d-%Y %H:%M')" # 02-25-2025 12:49 | |
| echo "NOW_LONG=${NOW_LONG}" >> $GITHUB_ENV | |
| NOW_DOCKER="$(date +'%Y%m%d')" # 20250225 | |
| echo "NOW_DOCKER=${NOW_DOCKER}" >> $GITHUB_ENV | |
| NOW_DOCKER_TS="$(date -u +'%FT%T.%3NZ')" # 2025-02-25T12:50:11.569Z | |
| echo "NOW_DOCKER_TS=${NOW_DOCKER_TS}" >> $GITHUB_ENV | |
| SHA1="$(git rev-parse HEAD)" # 71fad013cfce9116ec62779e4a7e627fe4c33627 | |
| echo "SHA1=${SHA1}" >> $GITHUB_ENV | |
| SHA1_GH="$(echo ${GITHUB_SHA})" # 71fad013cfce9116ec62779e4a7e627fe4c33627 | |
| echo "SHA1_GH=${SHA1_GH}" >> $GITHUB_ENV | |
| PKG_VER_1DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -d '.' -f1-1)" # 3.22 > 3 | |
| echo "PKG_VER_1DIGIT=${PKG_VER_1DIGIT}" >> $GITHUB_ENV | |
| PKG_VER_2DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -f2 -d ":" | cut -c1-3)" # 3.22 > 3.2 | |
| echo "PKG_VER_2DIGIT=${PKG_VER_2DIGIT}" >> $GITHUB_ENV | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| sudo apt -qq update | |
| sudo apt -qq install tree | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| echo " Runner .............. ${{ runner.name }}" | |
| echo " Workflow ............ ${{ github.workflow }} (#${{ github.workflow_ref }})" | |
| echo " Run Number .......... ${{ github.run_number }}" | |
| echo " Ref ................. ${{ github.ref }}" | |
| echo " Ref Name ............ ${{ github.ref_name }}" | |
| echo " Event Name .......... ${{ github.event_name }}" | |
| echo " Repo ................ ${{ github.repository }}" | |
| echo " Repo Owner .......... ${{ github.repository_owner }}" | |
| echo " Run ID .............. https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| echo " Triggered By ........ ${{ github.actor }}" | |
| echo " SHA 1 (GITHUB_SHA) .. ${GITHUB_SHA}" | |
| echo " SHA 2 (github.sha) .. ${{ github.sha }}" | |
| echo " SHA 3 (env.SHA1) .... ${SHA1}" | |
| echo " SHA 4 (env.SHA1_GH) . ${SHA1_GH}" | |
| echo " Workspace ........... ${{ github.workspace }}" | |
| echo " PWD ................. ${PWD}" | |
| echo " Job Name ............ ${{ steps.context.outputs.job_name }}" | |
| echo " Job ID .............. ${{ steps.context.outputs.job_id }}" | |
| echo " Job URL ............. ${{ steps.context.outputs.job_url }}" | |
| echo " Run ID .............. ${{ steps.context.outputs.run_id }}" | |
| echo " Run Attempt ......... ${{ steps.context.outputs.run_attempt }}" | |
| echo " Run Number .......... ${{ steps.context.outputs.run_number }}" | |
| echo " Run URL ............. ${{ steps.context.outputs.run_url }}" | |
| echo " Run Env ............. ${{ steps.context.outputs.environment }}" | |
| echo " Run Env URL ......... ${{ steps.context.outputs.environment_url }}" | |
| echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" | |
| echo " Run Deployment URL .. ${{ steps.context.outputs.deployment_url }}" | |
| echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" | |
| echo " Run Runner Name ..... ${{ steps.context.outputs.runner_name }}" | |
| echo " Run Runner ID ....... ${{ steps.context.outputs.runner_id }}" | |
| echo " Year ................ ${YEAR}" | |
| echo " Now ................. ${NOW}" | |
| echo " Now (Short) ......... ${NOW_SHORT}" | |
| echo " Now (Long) .......... ${NOW_LONG}" | |
| echo " Now (Docker) ........ ${NOW_DOCKER}" | |
| echo " Now (Docker TS) ..... ${NOW_DOCKER_TS}" | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| tree -I node_modules -I .git | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| # # | |
| # Release › Tags › Fix Permissions | |
| # # | |
| - name: '#️⃣ Manage Permissions' | |
| run: | | |
| find ./ -name 'run' -exec chmod 755 {} \; | |
| WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print) | |
| if [ -n "${WRONG_PERM}" ]; then | |
| echo "⚠️⚠️⚠️ Permissions are invalid ⚠️⚠️⚠️" | |
| for i in ${WRONG_PERM}; do | |
| echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!" | |
| done | |
| exit 1 | |
| else | |
| echo "✅✅✅ Executable permissions are OK ✅✅✅" | |
| fi | |
| # # | |
| # Release › Tags › Create Tag | |
| # | |
| # only called in dispatch mode | |
| # # | |
| - uses: rickstaa/action-create-tag@v1 | |
| id: task_release_tags_create | |
| if: ( github.event_name != 'workflow_dispatch' && inputs.DRY_RUN == false ) | |
| with: | |
| tag: "${{ env.IMAGE_VERSION }}" | |
| tag_exists_error: false | |
| message: '${{ env.IMAGE_NAME }}:${{ env.IMAGE_DISTRO }}-${{ env.IMAGE_VERSION }}' | |
| gpg_private_key: ${{ secrets.ADMINSERV_GPG_KEY_ASC }} | |
| gpg_passphrase: ${{ secrets.ADMINSERV_GPG_PASSPHRASE }} | |
| # # | |
| # Job › Docker Release › Dockerhub | |
| # # | |
| job-docker-release-dockerhub: | |
| name: >- | |
| 📦 Release › Dockerhub | |
| runs-on: ubuntu-latest | |
| # runs-on: apollo-x64 | |
| timeout-minutes: 20 | |
| permissions: | |
| contents: write | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| needs: [ job-docker-release-tags-create ] | |
| steps: | |
| # # | |
| # Release › Dockerhub › Checkout | |
| # # | |
| - name: '☑️ Checkout' | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # # | |
| # Release › Dockerhub › Job Information | |
| # # | |
| - name: >- | |
| 🔄 Load Job | |
| uses: qoomon/actions--context@v4 | |
| id: 'context' | |
| # # | |
| # Release › Dockerhub › Start | |
| # # | |
| - name: >- | |
| ✅ Start | |
| run: | | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo " Starting Job ${{ steps.context.outputs.job_name }}" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| YEAR="$(date +'%Y')" | |
| echo "YEAR=${YEAR}" >> $GITHUB_ENV | |
| NOW="$(date +'%m-%d-%Y %H:%M:%S')" # 02-25-2025 12:49:48 | |
| echo "NOW=${NOW}" >> $GITHUB_ENV | |
| NOW_SHORT="$(date +'%m-%d-%Y')" # 02-25-2025 | |
| echo "NOW_SHORT=${NOW_SHORT}" >> $GITHUB_ENV | |
| NOW_LONG="$(date +'%m-%d-%Y %H:%M')" # 02-25-2025 12:49 | |
| echo "NOW_LONG=${NOW_LONG}" >> $GITHUB_ENV | |
| NOW_DOCKER="$(date +'%Y%m%d')" # 20250225 | |
| echo "NOW_DOCKER=${NOW_DOCKER}" >> $GITHUB_ENV | |
| NOW_DOCKER_TS="$(date -u +'%FT%T.%3NZ')" # 2025-02-25T12:50:11.569Z | |
| echo "NOW_DOCKER_TS=${NOW_DOCKER_TS}" >> $GITHUB_ENV | |
| SHA1="$(git rev-parse HEAD)" # 71fad013cfce9116ec62779e4a7e627fe4c33627 | |
| echo "SHA1=${SHA1}" >> $GITHUB_ENV | |
| SHA1_GH="$(echo ${GITHUB_SHA})" # 71fad013cfce9116ec62779e4a7e627fe4c33627 | |
| echo "SHA1_GH=${SHA1_GH}" >> $GITHUB_ENV | |
| PKG_VER_1DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -d '.' -f1-1)" # 24.04 > 22 | |
| echo "PKG_VER_1DIGIT=${PKG_VER_1DIGIT}" >> $GITHUB_ENV | |
| PKG_VER_2DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -f2 -d ":" | cut -c1-4)" # 24.04 > 22.0 | |
| echo "PKG_VER_2DIGIT=${PKG_VER_2DIGIT}" >> $GITHUB_ENV | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| sudo apt -qq update | |
| sudo apt -qq install tree | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| echo " Runner .............. ${{ runner.name }}" | |
| echo " Workflow ............ ${{ github.workflow }} (#${{ github.workflow_ref }})" | |
| echo " Run Number .......... ${{ github.run_number }}" | |
| echo " Ref ................. ${{ github.ref }}" | |
| echo " Ref Name ............ ${{ github.ref_name }}" | |
| echo " Event Name .......... ${{ github.event_name }}" | |
| echo " Repo ................ ${{ github.repository }}" | |
| echo " Repo Owner .......... ${{ github.repository_owner }}" | |
| echo " Run ID .............. https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| echo " Triggered By ........ ${{ github.actor }}" | |
| echo " SHA 1 (GITHUB_SHA) .. ${GITHUB_SHA}" | |
| echo " SHA 2 (github.sha) .. ${{ github.sha }}" | |
| echo " SHA 3 (env.SHA1) .... ${SHA1}" | |
| echo " SHA 4 (env.SHA1_GH) . ${SHA1_GH}" | |
| echo " Workspace ........... ${{ github.workspace }}" | |
| echo " PWD ................. ${PWD}" | |
| echo " Job Name ............ ${{ steps.context.outputs.job_name }}" | |
| echo " Job ID .............. ${{ steps.context.outputs.job_id }}" | |
| echo " Job URL ............. ${{ steps.context.outputs.job_url }}" | |
| echo " Run ID .............. ${{ steps.context.outputs.run_id }}" | |
| echo " Run Attempt ......... ${{ steps.context.outputs.run_attempt }}" | |
| echo " Run Number .......... ${{ steps.context.outputs.run_number }}" | |
| echo " Run URL ............. ${{ steps.context.outputs.run_url }}" | |
| echo " Run Env ............. ${{ steps.context.outputs.environment }}" | |
| echo " Run Env URL ......... ${{ steps.context.outputs.environment_url }}" | |
| echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" | |
| echo " Run Deployment URL .. ${{ steps.context.outputs.deployment_url }}" | |
| echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" | |
| echo " Run Runner Name ..... ${{ steps.context.outputs.runner_name }}" | |
| echo " Run Runner ID ....... ${{ steps.context.outputs.runner_id }}" | |
| echo " Year ................ ${YEAR}" | |
| echo " Now ................. ${NOW}" | |
| echo " Now (Short) ......... ${NOW_SHORT}" | |
| echo " Now (Long) .......... ${NOW_LONG}" | |
| echo " Now (Docker) ........ ${NOW_DOCKER}" | |
| echo " Now (Docker TS) ..... ${NOW_DOCKER_TS}" | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| tree -I node_modules -I .git | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| # # | |
| # Release › Dockerhub › Set Vars | |
| # # | |
| - name: '🕛 Set Vars' | |
| run: | | |
| echo "REGISTRY_REPO_ORG_AUTHOR_LC=`echo ${{ env.IMAGE_DOCKERHUB_AUTHOR }}/${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]'`" >> ${GITHUB_ENV} # aetherinox/docker-base-ubuntu | |
| echo "REGISTRY_REPO_AUTHOR_LC=`echo ${{ env.IMAGE_DOCKERHUB_AUTHOR }} | tr '[:upper:]' '[:lower:]'`" >> ${GITHUB_ENV} # aetherinox | |
| # # | |
| # Release › Dockerhub › Install Dependencies | |
| # # | |
| - name: '📦 Install Dependencies' | |
| run: | |
| sudo apt-get install -qq dos2unix | |
| # # | |
| # Release › Dockerhub › Execute dos2unix | |
| # # | |
| - name: '🔐 Apply dos2unix' | |
| run: | | |
| echo "⚠️⚠️⚠️ Running DOS2UNIX ⚠️⚠️⚠️" | |
| find ./ \( -path "./.git" -o -path "./docs" -o -path "./.github" -o -path "*.png" -o -path "*.jpg" \) -prune -o -name '*' -print | xargs dos2unix -- | |
| echo "✅✅✅ Completed DOS2UNIX ✅✅✅" | |
| # # | |
| # Release › Dockerhub › Fix Permissions | |
| # # | |
| - name: '#️⃣ Manage Permissions' | |
| run: | | |
| find ./ -name 'run' -exec chmod 755 {} \; | |
| WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print) | |
| if [ -n "${WRONG_PERM}" ]; then | |
| echo "⚠️⚠️⚠️ Permissions are invalid ⚠️⚠️⚠️" | |
| for i in ${WRONG_PERM}; do | |
| echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!" | |
| done | |
| exit 1 | |
| else | |
| echo "✅✅✅ Executable permissions are OK ✅✅✅" | |
| fi | |
| # # | |
| # Release › Dockerhub › QEMU › Amd64 | |
| # # | |
| - name: '⚙️ Set up QEMU' | |
| uses: docker/setup-qemu-action@v3 | |
| # # | |
| # Release › Dockerhub › Setup BuildX › Amd64 | |
| # # | |
| - name: '⚙️ Setup Buildx' | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| version: latest | |
| driver-opts: 'image=moby/buildkit:latest' | |
| # # | |
| # Release › Dockerhub › Registry Login › Amd64 | |
| # # | |
| - name: '⚙️ Login to Dockerhub' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ env.IMAGE_DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.SELF_DOCKERHUB_TOKEN }} | |
| # # | |
| # Release › Dockerhub › Read Readme | |
| # | |
| # @usage org.opencontainers.image.description=${{ steps.task_release_dh_readme_cache.outputs.content }} | |
| # # | |
| - name: '📄 Cache README.md' | |
| id: task_release_dh_readme_cache | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.SELF_TOKEN_CL }} | |
| script: | | |
| 'use strict' | |
| const { promises: fs } = require('fs') | |
| const main = async () => { | |
| const path = "README.md" | |
| let content = await fs.readFile(path, 'utf8') | |
| core.setOutput('content', content) | |
| } | |
| main().catch(err => core.setFailed(err.message)) | |
| # # | |
| # Release › Dockerhub › Meta | |
| # | |
| # this version of meta does not need one for amd64 and one for arm64 because both | |
| # platforms are combined into one release, all sharing the same tags | |
| # # | |
| - name: '🔨 Dockerhub: Meta' | |
| id: task_release_dh_meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ env.REGISTRY_REPO_AUTHOR_LC }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| # tag latest = yes ( no dev ) | |
| type=raw,value=latest,enable=${{ !inputs.DEV_RELEASE }} | |
| # tag add pr tag ( PR or push only ) | |
| type=ref,enable=${{ github.event_name == 'pull_request' || github.event_name == 'push' }},priority=600,prefix=,suffix=,event=tag | |
| # tag add 24.04 ( dispatch only + no dev ) | |
| type=raw,enable=${{ github.event_name == 'workflow_dispatch' && inputs.DEV_RELEASE == false }},priority=400,prefix=,suffix=,value=${{ env.IMAGE_VERSION }} | |
| # tag add noble,jammy,etc ( dispatch only + no dev ) | |
| type=raw,enable=${{ github.event_name == 'workflow_dispatch' && inputs.DEV_RELEASE == false }},priority=400,prefix=,suffix=,value=${{ env.IMAGE_DISTRO }} | |
| # tag add noble-20250127 ( dispatch only + no dev ) | |
| type=raw,enable=${{ github.event_name == 'workflow_dispatch' && inputs.DEV_RELEASE == false }},priority=400,prefix=,suffix=,value=${{ env.IMAGE_DISTRO }}-${{ env.NOW_DOCKER }} | |
| # tag add noble-development ( dispatch only + only dev ) | |
| type=raw,enable=${{ github.event_name == 'workflow_dispatch' && inputs.DEV_RELEASE == true }},priority=300,prefix=,suffix=,value=${{ env.IMAGE_DISTRO }}-development | |
| # tag add noble-development ( distro + only dev ) | |
| type=raw,enable=${{ inputs.DEV_RELEASE }},priority=400,prefix=,suffix=,value=${{ env.IMAGE_DISTRO }}-development | |
| flavor: | | |
| latest=false | |
| labels: | | |
| org.opencontainers.image.authors=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.vendor=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.title=${{ env.IMAGE_NAME }} (Base) ${{ env.IMAGE_VERSION }} (${{ env.IMAGE_DISTRO }}) | |
| org.opencontainers.image.description=${{ env.IMAGE_NAME }} base image with s6-overlay integration | |
| org.opencontainers.image.created=${{ env.NOW_DOCKER_TS }} | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/wiki | |
| org.opencontainers.image.issues=https://github.com/${{ github.repository }}/issues | |
| org.opencontainers.image.licenses=MIT | |
| org.opencontainers.image.version=${{ env.IMAGE_VERSION || '24.04' }} | |
| org.opencontainers.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.opencontainers.image.branch=${{ github.ref_name }} | |
| org.opencontainers.image.registry=${{ env.IMAGE_REGISTRY }} | |
| org.opencontainers.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.opencontainers.image.development=${{ inputs.DEV_RELEASE == true && 'true' || 'false' }} | |
| org.opencontainers.image.sha=${{ github.sha }} | |
| org.ubuntu.image.maintainers=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.ubuntu.image.version=Version:- ${{ env.IMAGE_VERSION }} Date:- ${{ env.NOW_DOCKER }} | |
| org.ubuntu.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.ubuntu.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.ubuntu.image.sha=${{ github.sha }} | |
| annotations: | | |
| org.opencontainers.image.authors=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.vendor=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.title=${{ env.IMAGE_NAME }} (Base) ${{ env.IMAGE_VERSION }} (${{ env.IMAGE_DISTRO }}) | |
| org.opencontainers.image.description=${{ env.IMAGE_NAME }} base image with s6-overlay integration | |
| org.opencontainers.image.created=${{ env.NOW_DOCKER_TS }} | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/wiki | |
| org.opencontainers.image.issues=https://github.com/${{ github.repository }}/issues | |
| org.opencontainers.image.licenses=MIT | |
| org.opencontainers.image.version=${{ env.IMAGE_VERSION || '24.04' }} | |
| org.opencontainers.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.opencontainers.image.branch=${{ github.ref_name }} | |
| org.opencontainers.image.registry=${{ env.IMAGE_REGISTRY }} | |
| org.opencontainers.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.opencontainers.image.development=${{ inputs.DEV_RELEASE == true && 'true' || 'false' }} | |
| org.opencontainers.image.sha=${{ github.sha }} | |
| org.ubuntu.image.maintainers=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.ubuntu.image.version=Version:- ${{ env.IMAGE_VERSION }} Date:- ${{ env.NOW_DOCKER }} | |
| org.ubuntu.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.ubuntu.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.ubuntu.image.sha=${{ github.sha }} | |
| # # | |
| # Release › Dockerhub › Build and Push › Amd64 | |
| # # | |
| - name: '📦 Build & Push (linux/amd64)' | |
| id: task_release_dh_push_amd64 | |
| uses: docker/build-push-action@v6 | |
| if: ( github.event_name == 'workflow_dispatch' && inputs.DRY_RUN == false ) || ( github.event_name == 'push' ) | |
| with: | |
| allow: | | |
| network.host | |
| network: host | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/amd64 | |
| provenance: false | |
| sbom: false | |
| push: ${{ github.event_name != 'pull_request' }} | |
| labels: ${{ steps.task_release_dh_meta.outputs.labels }} | |
| tags: | | |
| ${{ steps.task_release_dh_meta.outputs.tags }} | |
| build-args: |- | |
| IMAGE_NAME=${{ env.IMAGE_NAME }} | |
| IMAGE_DISTRO=${{ env.IMAGE_DISTRO }} | |
| IMAGE_ARCH=amd64 | |
| IMAGE_BUILDDATE=${{ env.NOW_DOCKER }} | |
| IMAGE_RELEASE=${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }} | |
| IMAGE_REGISTRY=${{ env.IMAGE_REGISTRY }} | |
| IMAGE_SHA1=${{ env.SHA1 }} | |
| annotations: | | |
| org.opencontainers.image.authors=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.vendor=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.title=${{ env.IMAGE_NAME }} (Base) ${{ env.IMAGE_VERSION }} (${{ env.IMAGE_DISTRO }}) | |
| org.opencontainers.image.description=${{ env.IMAGE_NAME }} base image with s6-overlay integration | |
| org.opencontainers.image.created=${{ env.NOW_DOCKER_TS }} | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/wiki | |
| org.opencontainers.image.issues=https://github.com/${{ github.repository }}/issues | |
| org.opencontainers.image.licenses=MIT | |
| org.opencontainers.image.version=${{ env.IMAGE_VERSION || '24.04' }} | |
| org.opencontainers.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.opencontainers.image.branch=${{ github.ref_name }} | |
| org.opencontainers.image.registry=${{ env.IMAGE_REGISTRY }} | |
| org.opencontainers.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.opencontainers.image.development=${{ inputs.DEV_RELEASE == true && 'true' || 'false' }} | |
| org.opencontainers.image.sha=${{ github.sha }} | |
| org.opencontainers.image.architecture=amd64 | |
| org.ubuntu.image.maintainers=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.ubuntu.image.version=Version:- ${{ env.IMAGE_VERSION }} Date:- ${{ env.NOW_DOCKER }} | |
| org.ubuntu.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.ubuntu.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.ubuntu.image.sha=${{ github.sha }} | |
| org.ubuntu.image.architecture=amd64 | |
| # # | |
| # Release › Dockerhub › Export Digest › Amd64 | |
| # # | |
| - name: '📄 Export Digest (linux/amd64)' | |
| id: task_release_dh_digest_export_amd64 | |
| if: ( github.event_name == 'workflow_dispatch' && inputs.DRY_RUN == false ) || ( github.event_name == 'push' ) | |
| run: | | |
| mkdir -p /tmp/build-digest-amd64 | |
| digest="${{ steps.task_release_dh_push_amd64.outputs.digest }}" | |
| digest="${digest#sha256:}" | |
| touch "/tmp/build-digest-amd64/$digest" | |
| shell: bash | |
| # # | |
| # Release › Dockerhub › Upload Digest › Amd64 | |
| # # | |
| - name: '🔼 Upload Digest (linux/amd64)' | |
| id: task_release_dh_digest_upload_amd64 | |
| uses: actions/upload-artifact@v4 | |
| if: ( github.event_name == 'workflow_dispatch' && inputs.DRY_RUN == false ) || ( github.event_name == 'push' ) | |
| with: | |
| name: digest-amd64 | |
| path: /tmp/build-digest-amd64/* | |
| if-no-files-found: error | |
| retention-days: 10 | |
| # # | |
| # Release › Dockerhub › Build and Push › Arm64 | |
| # # | |
| - name: '📦 Build & Push (linux/arm64)' | |
| id: task_release_dh_push_arm64 | |
| uses: docker/build-push-action@v6 | |
| if: ( github.event_name == 'workflow_dispatch' && inputs.DRY_RUN == false ) || ( github.event_name == 'push' ) | |
| with: | |
| allow: | | |
| network.host | |
| network: host | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/arm64 | |
| provenance: false | |
| sbom: false | |
| push: ${{ github.event_name != 'pull_request' }} | |
| labels: ${{ steps.task_release_dh_meta.outputs.labels }} | |
| tags: | | |
| ${{ steps.task_release_dh_meta.outputs.tags }} | |
| build-args: |- | |
| IMAGE_NAME=${{ env.IMAGE_NAME }} | |
| IMAGE_DISTRO=${{ env.IMAGE_DISTRO }} | |
| IMAGE_ARCH=arm64 | |
| IMAGE_BUILDDATE=${{ env.NOW_DOCKER }} | |
| IMAGE_RELEASE=${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }} | |
| IMAGE_REGISTRY=${{ env.IMAGE_REGISTRY }} | |
| IMAGE_SHA1=${{ env.SHA1 }} | |
| annotations: |- | |
| org.opencontainers.image.authors=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.vendor=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.opencontainers.image.title=${{ env.IMAGE_NAME }} (Base) ${{ env.IMAGE_VERSION }} (${{ env.IMAGE_DISTRO }}) | |
| org.opencontainers.image.description=${{ env.IMAGE_NAME }} base image with s6-overlay integration | |
| org.opencontainers.image.created=${{ env.NOW_DOCKER_TS }} | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/wiki | |
| org.opencontainers.image.issues=https://github.com/${{ github.repository }}/issues | |
| org.opencontainers.image.licenses=MIT | |
| org.opencontainers.image.version=${{ env.IMAGE_VERSION || '24.04' }} | |
| org.opencontainers.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.opencontainers.image.branch=${{ github.ref_name }} | |
| org.opencontainers.image.registry=${{ env.IMAGE_REGISTRY }} | |
| org.opencontainers.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.opencontainers.image.development=${{ inputs.DEV_RELEASE == true && 'true' || 'false' }} | |
| org.opencontainers.image.sha=${{ github.sha }} | |
| org.opencontainers.image.architecture=arm64 | |
| org.ubuntu.image.maintainers=${{ env.REGISTRY_REPO_AUTHOR_LC }} | |
| org.ubuntu.image.version=Version:- ${{ env.IMAGE_VERSION }} Date:- ${{ env.NOW_DOCKER }} | |
| org.ubuntu.image.distro=${{ env.IMAGE_DISTRO || 'noble' }} | |
| org.ubuntu.image.release="${{ inputs.DEV_RELEASE == true && 'development' || 'stable' }}" | |
| org.ubuntu.image.sha=${{ github.sha }} | |
| org.ubuntu.image.architecture=arm64 | |
| # # | |
| # Release › Dockerhub › Export Digest › Arm64 | |
| # # | |
| - name: '📄 Export Digest (linux/arm64)' | |
| id: task_release_dh_digest_export_arm64 | |
| if: ( github.event_name == 'workflow_dispatch' && inputs.DRY_RUN == false ) || ( github.event_name == 'push' ) | |
| run: | | |
| mkdir -p /tmp/build-digest-arm64 | |
| digest="${{ steps.task_release_dh_push_arm64.outputs.digest }}" | |
| digest="${digest#sha256:}" | |
| touch "/tmp/build-digest-arm64/$digest" | |
| shell: bash | |
| # # | |
| # Release › Dockerhub › Upload Digest › Arm64 | |
| # # | |
| - name: '🔼 Upload Digest (linux/arm64)' | |
| id: task_release_dh_digest_upload_arm64 | |
| uses: actions/upload-artifact@v4 | |
| if: ( github.event_name == 'workflow_dispatch' && inputs.DRY_RUN == false ) || ( github.event_name == 'push' ) | |
| with: | |
| name: digest-arm64 | |
| path: /tmp/build-digest-arm64/* | |
| if-no-files-found: error | |
| retention-days: 10 | |
| # # | |
| # Release › Dockerhub › Checkpoint › Amd64 | |
| # # | |
| - name: '⚠️ Checkpoint' | |
| run: | | |
| echo "" | |
| echo "" | |
| echo "---- [ DOCKERHUB ] -------------------------------------------------------------------------------------" | |
| echo "github.actor.............................. ${{ github.actor }}" | |
| echo "github.ref ............................... ${{ github.ref }}" | |
| echo "github.ref_name .......................... ${{ github.ref_name }}" | |
| echo "github.event_name ........................ ${{ github.event_name }}" | |
| echo "github.repository_owner .................. ${{ github.repository_owner }}" | |
| echo "github.repository ........................ ${{ github.repository }}" | |
| echo "github.sha ............................... ${{ github.sha }}" | |
| echo "" | |
| echo "" | |
| echo "---- [ INPUTS ] ----------------------------------------------------------------------------------------" | |
| echo "inputs.IMAGE_NAME ........................ ${{ inputs.IMAGE_NAME }}" | |
| echo "inputs.IMAGE_DISTRO ...................... ${{ inputs.IMAGE_DISTRO }}" | |
| echo "inputs.IMAGE_VERSION ..................... ${{ inputs.IMAGE_VERSION }}" | |
| echo "inputs.IMAGE_GHCR_AUTHOR ................. ${{ inputs.IMAGE_DOCKERHUB_AUTHOR }}" | |
| echo "inputs.IMAGE_GHCR_USERNAME ............... ${{ inputs.IMAGE_DOCKERHUB_USERNAME }}" | |
| echo "inputs.DEV_RELEASE ....................... ${{ inputs.DEV_RELEASE }}" | |
| echo "inputs.DRY_RUN ........................... ${{ inputs.DRY_RUN }}" | |
| echo "" | |
| echo "" | |
| echo "---- [ ENV ] -------------------------------------------------------------------------------------------" | |
| echo "env.IMAGE_NAME ........................... ${{ env.IMAGE_NAME }}" | |
| echo "env.IMAGE_DISTRO ......................... ${{ env.IMAGE_DISTRO }}" | |
| echo "env.IMAGE_VERSION ........................ ${{ env.IMAGE_VERSION }}" | |
| echo "env.PKG_VER_1DIGIT ....................... ${{ env.PKG_VER_1DIGIT }}" | |
| echo "env.PKG_VER_2DIGIT ....................... ${{ env.PKG_VER_2DIGIT }}" | |
| echo "env.IMAGE_GHCR_AUTHOR .................... ${{ env.IMAGE_DOCKERHUB_AUTHOR }}" | |
| echo "env.IMAGE_GHCR_USERNAME .................. ${{ env.IMAGE_DOCKERHUB_USERNAME }}" | |
| echo "env.NOW .................................. ${{ env.NOW }}" | |
| echo "env.NOW_SHORT ............................ ${{ env.NOW_SHORT }}" | |
| echo "env.NOW_LONG ............................. ${{ env.NOW_LONG }}" | |
| echo "env.NOW_DOCKER ........................... ${{ env.NOW_DOCKER }}" | |
| echo "env.NOW_DOCKER_TS ........................ ${{ env.NOW_DOCKER_TS }}" | |
| echo "env.REGISTRY_REPO_ORG_AUTHOR_LC .......... ${{ env.REGISTRY_REPO_ORG_AUTHOR_LC }}" | |
| echo "env.REGISTRY_REPO_AUTHOR_LC .............. ${{ env.REGISTRY_REPO_AUTHOR_LC }}" | |
| echo "env.SHA1 ................................. ${{ env.SHA1 }}" | |
| echo "" | |
| echo "" | |
| echo "---- [ DOCKER IMAGES ] ---------------------------------------------------------------------------------" | |
| echo "registry ................................. ${{ env.IMAGE_REGISTRY }} GHCR" | |
| echo "tags ..................................... ${{ steps.task_release_dh_meta.outputs.tags }}" | |
| echo "labels ................................... ${{ steps.task_release_dh_meta.outputs.labels }}" | |
| echo "digest ................................... ${{ steps.task_release_dh_push_amd64.outputs.digest }}" | |
| echo "" | |
| echo "" | |
| echo "(release) tags ........................... ${{ steps.task_release_dh_meta.outputs.tags }}" | |
| echo "(release) labels ......................... ${{ steps.task_release_dh_meta.outputs.labels }}" | |
| echo "" | |
| echo "" | |
| echo "---- [ DOCKER DIGESTS ] --------------------------------------------------------------------------------" | |
| echo "docker image id (amd64) .................. ${{ steps.task_release_dh_push_amd64.outputs.imageid }}" | |
| echo "docker digest (amd64) .................... ${{ steps.task_release_dh_push_amd64.outputs.digest }}" | |
| echo "docker image id (arm64) .................. ${{ steps.task_release_dh_push_arm64.outputs.imageid }}" | |
| echo "docker digest (arm64) .................... ${{ steps.task_release_dh_push_arm64.outputs.digest }}" | |
| echo "" | |
| echo "" | |
| # # | |
| # Release › Dockerhub › Push Manifest | |
| # # | |
| - name: '📦 Push Manifest' | |
| uses: int128/docker-manifest-create-action@v2 | |
| with: | |
| push: ${{ !inputs.DRY_RUN }} | |
| tags: | | |
| ${{ steps.task_release_dh_meta.outputs.tags }} | |
| sources: | | |
| ${{ env.REGISTRY_REPO_ORG_AUTHOR_LC }}@${{ steps.task_release_dh_push_amd64.outputs.digest }} | |
| ${{ env.REGISTRY_REPO_ORG_AUTHOR_LC }}@${{ steps.task_release_dh_push_arm64.outputs.digest }} | |
| index-annotations: | | |
| ${{ 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/[email protected] | |
| if: success() | |
| with: | |
| username: ${{ env.DISCORD_BOT_NAME }} | |
| avatar-url: ${{ env.DISCORD_BOT_AVATAR }} | |
| webhook-url: ${{ secrets.DISCORD_WEBHOOK_CHAN_GITHUB_BASEALPINE_RELEASES }} | |
| embed-title: "⚙️ ${{ github.workflow_ref }}" | |
| embed-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| embed-thumbnail-url: ${{ env.DISCORD_BOT_EMBED_THUMBNAIL }} | |
| embed-description: | | |
| ### 📦 Deploy (${{ env.IMAGE_REGISTRY }}) ${{ job.status == 'success' && '✅' || '❌' }} › `${{ env.IMAGE_NAME }}:${{ env.IMAGE_DISTRO }}-${{ env.IMAGE_VERSION }}${{ inputs.DEV_RELEASE == true && '-development' || '' }}` | |
| ${{ inputs.DEV_RELEASE == true && '### ⚠️⚠️ Development / Pre-release ⚠️⚠️' || '' }} | |
| A new version of the docker container `${{ env.IMAGE_NAME }}:${{ env.IMAGE_DISTRO }}-${{ env.IMAGE_VERSION }}` has been released from Github to ${{ env.IMAGE_REGISTRY }}. The image is available at: | |
| - https://hub.docker.com/r/${{ env.IMAGE_DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} | |
| - Version: `${{ env.IMAGE_VERSION }}` | |
| - Release Type: `${{ inputs.DEV_RELEASE == true && '⚠️⚠️ Development / Pre-release ⚠️⚠️' || 'Stable' }}` | |
| - Pull: `docker pull ${{ env.REGISTRY_REPO_ORG_AUTHOR_LC }}:${{ inputs.DEV_RELEASE == true && 'development' || env.IMAGE_VERSION }}` | |
| - Pull (amd64): `docker pull ${{ env.REGISTRY_REPO_ORG_AUTHOR_LC }}@${{ steps.task_release_dh_push_amd64.outputs.digest }}` | |
| - Pull (arm64): `docker pull ${{ env.REGISTRY_REPO_ORG_AUTHOR_LC }}@${{ steps.task_release_dh_push_arm64.outputs.digest }}` | |
| - Dry Run: `${{ inputs.DRY_RUN }}` | |
| - Source: `${{ env.IMAGE_REGISTRY }}` https://hub.docker.com/r/${{ env.IMAGE_DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} | |
| - Docker Image: `${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }}${{ inputs.DEV_RELEASE == true && '-development' || '' }}` | |
| - Branch: `${{ github.ref_name }}` | |
| - Workflow: `${{ github.workflow }} (#${{github.run_number}})` | |
| - Runner: `${{ runner.name }}` | |
| - Triggered By: `${{ github.actor }}` | |
| - Status: `${{ job.status == 'success' && '✅ Successful' || '❌ Failed' }}` | |
| ### 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.repository_owner }}" | |
| embed-author-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| embed-author-icon-url: ${{ env.DISCORD_BOT_EMBED_AUTHOR_ICON }} | |
| # # | |
| # Job › Docker Release › Cleanup | |
| # # | |
| job-docker-release-cleanup: | |
| name: >- | |
| 🧹 Release › Cleanup | |
| runs-on: ubuntu-latest | |
| # runs-on: apollo-x64 | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: write | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| needs: [ job-docker-release-tags-create, job-docker-release-dockerhub ] | |
| steps: | |
| # # | |
| # Cleanup › Tags › Checkout | |
| # # | |
| - name: '☑️ Checkout' | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # # | |
| # Cleanup › Tags › Job Information | |
| # # | |
| - name: >- | |
| 🔄 Load Job | |
| uses: qoomon/actions--context@v4 | |
| id: 'context' | |
| # # | |
| # Cleanup › Tags › Start | |
| # # | |
| - name: >- | |
| ✅ Start | |
| run: | | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo " Starting Job ${{ steps.context.outputs.job_name }}" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| YEAR="$(date +'%Y')" | |
| echo "YEAR=${YEAR}" >> $GITHUB_ENV | |
| NOW="$(date +'%m-%d-%Y %H:%M:%S')" # 02-25-2025 12:49:48 | |
| echo "NOW=${NOW}" >> $GITHUB_ENV | |
| NOW_SHORT="$(date +'%m-%d-%Y')" # 02-25-2025 | |
| echo "NOW_SHORT=${NOW_SHORT}" >> $GITHUB_ENV | |
| NOW_LONG="$(date +'%m-%d-%Y %H:%M')" # 02-25-2025 12:49 | |
| echo "NOW_LONG=${NOW_LONG}" >> $GITHUB_ENV | |
| NOW_DOCKER="$(date +'%Y%m%d')" # 20250225 | |
| echo "NOW_DOCKER=${NOW_DOCKER}" >> $GITHUB_ENV | |
| NOW_DOCKER_TS="$(date -u +'%FT%T.%3NZ')" # 2025-02-25T12:50:11.569Z | |
| echo "NOW_DOCKER_TS=${NOW_DOCKER_TS}" >> $GITHUB_ENV | |
| SHA1="$(git rev-parse HEAD)" # 71fad013cfce9116ec62779e4a7e627fe4c33627 | |
| echo "SHA1=${SHA1}" >> $GITHUB_ENV | |
| SHA1_GH="$(echo ${GITHUB_SHA})" # 71fad013cfce9116ec62779e4a7e627fe4c33627 | |
| echo "SHA1_GH=${SHA1_GH}" >> $GITHUB_ENV | |
| PKG_VER_1DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -d '.' -f1-1)" # 3.22 > 3 | |
| echo "PKG_VER_1DIGIT=${PKG_VER_1DIGIT}" >> $GITHUB_ENV | |
| PKG_VER_2DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -f2 -d ":" | cut -c1-3)" # 3.22 > 3.2 | |
| echo "PKG_VER_2DIGIT=${PKG_VER_2DIGIT}" >> $GITHUB_ENV | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| sudo apt -qq update | |
| sudo apt -qq install tree | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| echo " Runner .............. ${{ runner.name }}" | |
| echo " Workflow ............ ${{ github.workflow }} (#${{ github.workflow_ref }})" | |
| echo " Run Number .......... ${{ github.run_number }}" | |
| echo " Ref ................. ${{ github.ref }}" | |
| echo " Ref Name ............ ${{ github.ref_name }}" | |
| echo " Event Name .......... ${{ github.event_name }}" | |
| echo " Repo ................ ${{ github.repository }}" | |
| echo " Repo Owner .......... ${{ github.repository_owner }}" | |
| echo " Run ID .............. https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| echo " Triggered By ........ ${{ github.actor }}" | |
| echo " SHA 1 (GITHUB_SHA) .. ${GITHUB_SHA}" | |
| echo " SHA 2 (github.sha) .. ${{ github.sha }}" | |
| echo " SHA 3 (env.SHA1) .... ${SHA1}" | |
| echo " SHA 4 (env.SHA1_GH) . ${SHA1_GH}" | |
| echo " Workspace ........... ${{ github.workspace }}" | |
| echo " PWD ................. ${PWD}" | |
| echo " Job Name ............ ${{ steps.context.outputs.job_name }}" | |
| echo " Job ID .............. ${{ steps.context.outputs.job_id }}" | |
| echo " Job URL ............. ${{ steps.context.outputs.job_url }}" | |
| echo " Run ID .............. ${{ steps.context.outputs.run_id }}" | |
| echo " Run Attempt ......... ${{ steps.context.outputs.run_attempt }}" | |
| echo " Run Number .......... ${{ steps.context.outputs.run_number }}" | |
| echo " Run URL ............. ${{ steps.context.outputs.run_url }}" | |
| echo " Run Env ............. ${{ steps.context.outputs.environment }}" | |
| echo " Run Env URL ......... ${{ steps.context.outputs.environment_url }}" | |
| echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" | |
| echo " Run Deployment URL .. ${{ steps.context.outputs.deployment_url }}" | |
| echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}" | |
| echo " Run Runner Name ..... ${{ steps.context.outputs.runner_name }}" | |
| echo " Run Runner ID ....... ${{ steps.context.outputs.runner_id }}" | |
| echo " Year ................ ${YEAR}" | |
| echo " Now ................. ${NOW}" | |
| echo " Now (Short) ......... ${NOW_SHORT}" | |
| echo " Now (Long) .......... ${NOW_LONG}" | |
| echo " Now (Docker) ........ ${NOW_DOCKER}" | |
| echo " Now (Docker TS) ..... ${NOW_DOCKER_TS}" | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| tree -I node_modules -I .git | |
| echo "" | |
| echo "" | |
| echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――" | |
| echo "" | |
| echo "" | |
| # # | |
| # Cleanup › Clean Untagged Images | |
| # # | |
| - name: '🧹 Clean Untagged Images' | |
| uses: Chizkiyahu/delete-untagged-ghcr-action@v6 | |
| with: | |
| owner_type: user | |
| token: ${{ secrets.SELF_TOKEN_CL }} | |
| repository_owner: ${{ github.repository_owner }} | |
| repository: ${{ github.repository }} | |
| untagged_only: true |