-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
.github/workflows/update-website-after-desktop-release.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Update Website after Desktop Release | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
update-website: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create path variables | ||
id: path_variables | ||
run: | | ||
tag=$(git describe --tags --abbrev=0 --match "*-desktop") | ||
version=$(echo "$tag" | sed 's/-desktop$//') | ||
echo "VERSION=$version" >> $GITHUB_ENV | ||
- name: Update website | ||
run: | | ||
file_path="website/data/hero.yml" | ||
new_link="https://github.com/prof18/feed-flow/releases/download/$VERSION-desktop/FeedFlow-$VERSION.dmg" | ||
awk -v new_link="$new_link" '/^button3Link:/ {print "button3Link: " new_link; next} 1' "$file_path" > tmpfile && mv tmpfile "$file_path" | ||
env: | ||
VERSION: ${{ steps.path_variables.outputs.VERSION }} | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: '0.101.0' | ||
extended: true | ||
|
||
- name: Build | ||
run: | | ||
cd website | ||
HUGO_ENV=production hugo --gc --minify | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: website/public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.