Update obfuscate workflow: Introduced environment variables for Gitea host and repository path, streamlined commit process to skip CI for bot commits, and adjusted remote URL configuration for secure pushes. Enhanced build process by removing unnecessary steps and ensuring efficient asset obfuscation and hashing.
This commit is contained in:
@@ -6,8 +6,14 @@ on:
|
|||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITEA_HOST: git.hexahost.dev
|
||||||
|
REPO_PATH: smueller/HexaHost-Frontend
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
obfuscate:
|
obfuscate:
|
||||||
|
# Kein erneuter Lauf nach dem Bot-Commit
|
||||||
|
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -15,15 +21,8 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
# Gitea liefert intern oft eine IP; Zertifikat gilt für git.hexahost.dev
|
||||||
- name: Skip loop commits
|
repository-url: https://git.hexahost.dev/smueller/HexaHost-Frontend
|
||||||
run: |
|
|
||||||
msg="$(git log -1 --pretty=%B)"
|
|
||||||
echo "Last commit message: $msg"
|
|
||||||
if echo "$msg" | grep -q "\[skip ci\]"; then
|
|
||||||
echo "Skip CI commit detected."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -39,13 +38,16 @@ jobs:
|
|||||||
run: python scripts/obfuscate_release.py --root . --hash-assets
|
run: python scripts/obfuscate_release.py --root . --hash-assets
|
||||||
|
|
||||||
- name: Commit obfuscated build
|
- name: Commit obfuscated build
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
git config user.name "gitea-actions"
|
git config user.name "gitea-actions"
|
||||||
git config user.email "actions@local"
|
git config user.email "actions@local"
|
||||||
|
git remote set-url origin "https://oauth2:${GITEA_TOKEN}@${GITEA_HOST}/${REPO_PATH}.git"
|
||||||
git add -A
|
git add -A
|
||||||
if git diff --cached --quiet; then
|
if git diff --cached --quiet; then
|
||||||
echo "No build changes to commit."
|
echo "No build changes to commit."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
git commit -m "chore(release): obfuscate and hash production assets [skip ci]"
|
git commit -m "chore(release): obfuscate and hash production assets [skip ci]"
|
||||||
git push
|
git push origin HEAD:main
|
||||||
|
|||||||
Reference in New Issue
Block a user