Skip to content

Update Website after Desktop Release #2

Update Website after Desktop Release

Update Website after Desktop Release #2

name: Update Website after Desktop Release
on:
workflow_dispatch: {}
release:
types: [released]
jobs:
update-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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