Skip to content

Commit fb5692e

Browse files
workflow cleanup
1 parent c9f2e07 commit fb5692e

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ concurrency:
1919

2020
# Reduce default permissions for security
2121
permissions:
22-
contents: read
23-
checks: write
24-
actions: read
22+
contents: write
2523

2624
jobs:
2725
# Build (produce production artifacts)

.github/workflows/release-ci.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
run: tar -cvzf bwmon.tar.gz react/build server
4949
- name: Setup git config
5050
run: |
51-
git config user.name "${GITHUB_ACTOR}"
52-
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
51+
git config --global user.name "${GITHUB_ACTOR}"
52+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
5353
- name: Commit release
5454
run: |
5555
git status
@@ -73,3 +73,25 @@ jobs:
7373
fi
7474
env:
7575
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
- name: Update README with new release version
77+
run: |
78+
sed -i "s|wget https://github.com/VREMSoftwareDevelopment/bwmon/releases/download/v[0-9.\-]*/bwmon.tar.gz|wget https://github.com/VREMSoftwareDevelopment/bwmon/releases/download/v${{ github.event.inputs.version }}/bwmon.tar.gz|g" README.md
79+
sed -i "s|Try a demo version of this application|Try the latest demo version|g" README.md
80+
shell: bash
81+
- name: Commit updated README
82+
run: |
83+
git add README.md
84+
git commit -m "Update README for release v${{ github.event.inputs.version }}" || echo "No README changes to commit"
85+
git push origin main || echo "README push failed or blocked"
86+
working-directory: react
87+
- name: Deploy to GitHub Pages (gh CLI)
88+
run: |
89+
git fetch origin gh-pages:gh-pages || git checkout --orphan gh-pages
90+
rm -rf asset-manifest.json favicon.ico index.html manifest.json robots.txt static usage.db
91+
cp -r react/build/* ./
92+
touch .nojekyll
93+
git add .
94+
git commit -m "Deploy to GitHub Pages: ${{ github.sha }}" || echo "No changes to commit"
95+
git push origin gh-pages --force
96+
env:
97+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)