Skip to content

publish

publish #18644

Workflow file for this run

name: publish
on:
push:
branches:
- master
schedule:
- cron: '0 * * * *'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: publish
run: |
git config --global user.name 'ajou-hack-bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/ajou-hack/notice-rss
cargo build --release
LAST_INDEX=$(cat ./last_index)
XML=$(./target/release/notice-rss $LAST_INDEX xml 2> /dev/null)
CM=$(./target/release/notice-rss $LAST_INDEX cm 2> /dev/null)
if [ -z "$XML" ] || [ -z "$CM" ]; then
echo "new notices not found"
exit 0
fi
echo $XML > rss.xml
cat ./target/release/last_index > ./last_index
git add -A
git commit -m "$CM"
git push origin master