Skip to content

Commit 5dbe36f

Browse files
committed
ci: update workflows
1 parent 20550d7 commit 5dbe36f

11 files changed

+5172
-3511
lines changed

.github/workflows/cache-clean.yml

Lines changed: 302 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/deploy-clean.yml

Lines changed: 115 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
# secrets.PYPI_API_TOKEN self Pypi API token (production site) - https://pypi.org/
1313
# secrets.PYPI_API_TEST_TOKEN self Pypi API token (test site) - https://test.pypi.org/
1414
# secrets.SELF_DOCKERHUB_TOKEN self Dockerhub token
15+
# secrets.CODECOV_TOKEN codecov upload token for nodejs projects
16+
# secrets.MAXMIND_GELITE_TOKEN maxmind API token
17+
# secrets.CF_ACCOUNT_ID cloudflare account id
18+
# secrets.CF_ACCOUNT_TOKEN cloudflare account token
1519
# secrets.ORG_TOKEN org github personal access token (fine-grained)
1620
# secrets.ORG_TOKEN_CL org github personal access token (classic)
1721
# secrets.ORG_DOCKERHUB_TOKEN org dockerhub secret
1822
# secrets.ORG_GITEA_TOKEN org gitea personal access token (classic) with package:write permission
1923
# secrets.BOT_GPG_KEY_ASC bot gpg private key (armored) | BEGIN PGP PRIVATE KEY BLOCK
24+
# secrets.BOT_GPG_KEY_B64 bot gpg private key (binary) converted to base64
2025
# secrets.BOT_GPG_PASSPHRASE bot gpg private key passphrase
2126
# secrets.DISCORD_WEBHOOK_CHAN_GITHUB_RELEASES discord webhook to report release notifications from github to discord
2227
# secrets.DISCORD_WEBHOOK_CHAN_GITHUB_WORKFLOWS discord webhook to report workflow notifications from github to discord
@@ -103,37 +108,129 @@ jobs:
103108
steps:
104109

105110
# #
106-
# Cleanup › Set Env Variables
111+
# Deployments › Clean › Checkout
112+
# #
113+
114+
- name: '☑️ Checkout'
115+
uses: actions/checkout@v4
116+
with:
117+
fetch-depth: 0
118+
119+
# #
120+
# Deployments › Clean › Job Information
107121
# #
108122

109123
- name: >-
110-
🕛 Get Timestamp
111-
id: task_cleanup_set_timestamp
112-
run: |
113-
echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV
114-
echo "NOW=$(date +'%m-%d-%Y %H:%M:%S')" >> $GITHUB_ENV
115-
echo "NOW_SHORT=$(date +'%m-%d-%Y')" >> $GITHUB_ENV
116-
echo "NOW_LONG=$(date +'%m-%d-%Y %H:%M')" >> $GITHUB_ENV
117-
echo "NOW_DOCKER_LABEL=$(date +'%Y%m%d')" >> $GITHUB_ENV
124+
🔄 Load Job
125+
uses: qoomon/actions--context@v4
126+
id: 'context'
118127
119128
# #
120-
# ReleaseGithubCheckout › Arm64
129+
# DeploymentsCleanStart
121130
# #
122131

123132
- name: >-
124-
✅ Checkout
125-
id: task_cleanup_gh_checkout
126-
uses: actions/checkout@v4
127-
with:
128-
fetch-depth: 0
133+
✅ Start
134+
run: |
135+
echo "‎"
136+
echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――"
137+
echo " Starting Job ${{ steps.context.outputs.job_name }}"
138+
echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――"
139+
140+
YEAR="$(date +'%Y')"
141+
echo "YEAR=${YEAR}" >> $GITHUB_ENV
142+
143+
NOW="$(date +'%m-%d-%Y %H:%M:%S')" # 02-25-2025 12:49:48
144+
echo "NOW=${NOW}" >> $GITHUB_ENV
145+
146+
NOW_SHORT="$(date +'%m-%d-%Y')" # 02-25-2025
147+
echo "NOW_SHORT=${NOW_SHORT}" >> $GITHUB_ENV
148+
149+
NOW_LONG="$(date +'%m-%d-%Y %H:%M')" # 02-25-2025 12:49
150+
echo "NOW_LONG=${NOW_LONG}" >> $GITHUB_ENV
151+
152+
NOW_DOCKER="$(date +'%Y%m%d')" # 20250225
153+
echo "NOW_DOCKER=${NOW_DOCKER}" >> $GITHUB_ENV
154+
155+
NOW_DOCKER_TS="$(date -u +'%FT%T.%3NZ')" # 2025-02-25T12:50:11.569Z
156+
echo "NOW_DOCKER_TS=${NOW_DOCKER_TS}" >> $GITHUB_ENV
157+
158+
SHA1="$(git rev-parse HEAD)" # 71fad013cfce9116ec62779e4a7e627fe4c33627
159+
echo "SHA1=${SHA1}" >> $GITHUB_ENV
160+
161+
SHA1_GH="$(echo ${GITHUB_SHA})" # 71fad013cfce9116ec62779e4a7e627fe4c33627
162+
echo "SHA1_GH=${SHA1_GH}" >> $GITHUB_ENV
163+
164+
PKG_VER_1DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -d '.' -f1-1)" # 3.22 > 3
165+
echo "PKG_VER_1DIGIT=${PKG_VER_1DIGIT}" >> $GITHUB_ENV
166+
167+
PKG_VER_2DIGIT="$(echo ${{ env.IMAGE_VERSION }} | cut -f2 -d ":" | cut -c1-3)" # 3.22 > 3.2
168+
echo "PKG_VER_2DIGIT=${PKG_VER_2DIGIT}" >> $GITHUB_ENV
169+
170+
echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――"
171+
echo "‎"
172+
echo "‎"
173+
sudo apt -qq update
174+
sudo apt -qq install tree
175+
echo "‎"
176+
echo "‎"
177+
echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――"
178+
echo "‎"
179+
echo "‎"
180+
echo " Runner .............. ${{ runner.name }}"
181+
echo " Workflow ............ ${{ github.workflow }} (#${{ github.workflow_ref }})"
182+
echo " Run Number .......... ${{ github.run_number }}"
183+
echo " Ref ................. ${{ github.ref }}"
184+
echo " Ref Name ............ ${{ github.ref_name }}"
185+
echo " Event Name .......... ${{ github.event_name }}"
186+
echo " Repo ................ ${{ github.repository }}"
187+
echo " Repo Owner .......... ${{ github.repository_owner }}"
188+
echo " Run ID .............. https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
189+
echo " Triggered By ........ ${{ github.actor }}"
190+
echo " SHA 1 (GITHUB_SHA) .. ${GITHUB_SHA}"
191+
echo " SHA 2 (github.sha) .. ${{ github.sha }}"
192+
echo " SHA 3 (env.SHA1) .... ${SHA1}"
193+
echo " SHA 4 (env.SHA1_GH) . ${SHA1_GH}"
194+
echo " Workspace ........... ${{ github.workspace }}"
195+
echo " PWD ................. ${PWD}"
196+
echo " Job Name ............ ${{ steps.context.outputs.job_name }}"
197+
echo " Job ID .............. ${{ steps.context.outputs.job_id }}"
198+
echo " Job URL ............. ${{ steps.context.outputs.job_url }}"
199+
echo " Run ID .............. ${{ steps.context.outputs.run_id }}"
200+
echo " Run Attempt ......... ${{ steps.context.outputs.run_attempt }}"
201+
echo " Run Number .......... ${{ steps.context.outputs.run_number }}"
202+
echo " Run URL ............. ${{ steps.context.outputs.run_url }}"
203+
echo " Run Env ............. ${{ steps.context.outputs.environment }}"
204+
echo " Run Env URL ......... ${{ steps.context.outputs.environment_url }}"
205+
echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}"
206+
echo " Run Deployment URL .. ${{ steps.context.outputs.deployment_url }}"
207+
echo " Run Deployment ...... ${{ steps.context.outputs.deployment_id }}"
208+
echo " Run Runner Name ..... ${{ steps.context.outputs.runner_name }}"
209+
echo " Run Runner ID ....... ${{ steps.context.outputs.runner_id }}"
210+
echo " Year ................ ${YEAR}"
211+
echo " Now ................. ${NOW}"
212+
echo " Now (Short) ......... ${NOW_SHORT}"
213+
echo " Now (Long) .......... ${NOW_LONG}"
214+
echo " Now (Docker) ........ ${NOW_DOCKER}"
215+
echo " Now (Docker TS) ..... ${NOW_DOCKER_TS}"
216+
echo "‎"
217+
echo "‎"
218+
echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――"
219+
echo "‎"
220+
echo "‎"
221+
tree -I node_modules -I .git
222+
echo "‎"
223+
echo "‎"
224+
echo "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――"
225+
echo "‎"
226+
echo "‎"
129227
130228
# #
131-
# Cleanup › Start
229+
# Deployments › Clean › Start
132230
# #
133231

134232
- name: >-
135233
⚙️ Deployments › Clean
136-
id: task_cleanup_start
137234
uses: Aetherinox/delete-deploy-env-action@v3
138235
with:
139236
token: ${{ secrets.SELF_TOKEN_CL }}
@@ -142,12 +239,11 @@ jobs:
142239
delay: "${{ env.DEPLOYMENT_DELAY }}"
143240
144241
# #
145-
# Cleanup › Get Weekly Commits
242+
# Deployments › Clean › Get Weekly Commits
146243
# #
147244

148245
- name: >-
149246
🕛 Get Weekly Commit List
150-
id: task_cleanup_set_weekly_commit_list
151247
run: |
152248
echo 'WEEKLY_COMMITS<<EOF' >> $GITHUB_ENV
153249
git log --format="[\`%h\`](${{ github.server_url }}/${{ github.repository }}/commit/%H) %s - %an" --since=7.days >> $GITHUB_ENV

0 commit comments

Comments
 (0)