Skip to content

Commit 42ea958

Browse files
committed
chore: push badges to assets branch
Signed-off-by: GRBurst <GRBurst@protonmail.com>
1 parent b55e315 commit 42ea958

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,36 +76,32 @@ jobs:
7676
coverage run -m pytest -s
7777
coverage report -m
7878
79-
- name: Checkout badges
80-
if: github.ref_name == 'main' && github.event_name == 'push'
81-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # pin@v3
82-
with:
83-
ref: badges
84-
path: badges
79+
- name: Create Badge Directory
80+
if: always() && github.ref_name == 'main' && github.event_name == 'push'
81+
run: mkdir -p badges
8582

8683
- name: Create Coverage Badge
8784
if: github.ref_name == 'main' && github.event_name == 'push'
8885
uses: tj-actions/coverage-badge-py@782bdaaa8b2e37612e6b6fac5e559e5544e6eef2 # pin@v2
8986
with:
9087
output: badges/coverage.svg
9188

92-
- name: Commit badge
89+
- name: Commit Badge
9390
if: github.ref_name == 'main' && github.event_name == 'push'
9491
run: |
95-
cd badges
9692
if [[ -n "$(git status --porcelain)" ]]; then
9793
git config --local user.email "action@github.com"
9894
git config --local user.name "GitHub Action"
99-
git add .
95+
git add badges/coverage.svg
10096
git commit -m "Update coverage badge"
10197
fi
10298
103-
- name: Push badge commit
99+
- name: Push Badge
104100
if: github.ref_name == 'main' && github.event_name == 'push'
105101
uses: ad-m/github-push-action@d9117be7cad08757e9e906a1bcd1716d6b192db5 # pin@master
106102
with:
107103
github_token: ${{ secrets.GITHUB_TOKEN }}
108-
branch: badges
104+
branch: assets
109105

110106
deploy:
111107
name: "Deploy"

0 commit comments

Comments
 (0)