Update Gitea workflow for obfuscation: Added environment variables for Gitea host and repository path, modified git remote URL for pushing obfuscated builds, and ensured proper handling of commits with no changes. This enhances the deployment process for production assets.
This commit is contained in:
@@ -6,6 +6,11 @@ on:
|
|||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Gitea liefert intern oft eine IP; das SSL-Zertifikat gilt für den Hostnamen.
|
||||||
|
GITEA_HOST: git.hexahost.dev
|
||||||
|
REPO_PATH: smueller/HexaHost-Frontend
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
obfuscate:
|
obfuscate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -15,6 +20,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
repository-url: https://git.hexahost.dev/smueller/HexaHost-Frontend
|
||||||
|
|
||||||
- name: Skip loop commits
|
- name: Skip loop commits
|
||||||
run: |
|
run: |
|
||||||
@@ -39,13 +45,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