Merge pull request 'ci: promote only main to GitHub, never tags' (#18) from ci/promote-without-tags into main
This commit was merged in pull request #18.
This commit is contained in:
commit
b9b97bdfc6
1 file changed
+8
-9
@@ -1,10 +1,14 @@
|
|||||||
name: Promote → GitHub
|
name: Promote → GitHub
|
||||||
|
|
||||||
# Runs on GITEA ONLY. Mirrors only main + version tags to the public GitHub repo.
|
# Runs on GITEA ONLY. Mirrors main, and nothing else, to the public GitHub repo.
|
||||||
|
#
|
||||||
|
# No tags. The site deploys by hand to cPanel, so a tag on GitHub has nothing to trigger. Pushing
|
||||||
|
# them also broke this job: `git push --tags` is refused whenever a tag points at different objects
|
||||||
|
# on the two forges (v26.8.1-beta.0 and v26.8.2-beta.0 did), and that failed every promotion even
|
||||||
|
# though main had already arrived.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
tags: ['v*']
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push-github:
|
push-github:
|
||||||
@@ -14,14 +18,9 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Push main + tags to GitHub
|
- name: Push main to GitHub
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/green-tea-site.git"
|
git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/green-tea-site.git"
|
||||||
if [ "${{ github.ref_type }}" = "tag" ]; then
|
git push github "HEAD:refs/heads/main"
|
||||||
git push github "refs/tags/${{ github.ref_name }}"
|
|
||||||
else
|
|
||||||
git push github "HEAD:refs/heads/main"
|
|
||||||
git push github --tags
|
|
||||||
fi
|
|
||||||
Reference in new issue
Block a user