Check update #4635
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
name: Check update | |
on: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 12 * * *' | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: check this week in rust and post to telegram | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: create env | |
run: touch ./.env | |
- name: read latest last-id | |
uses: sergeysova/gist-read-action@v1 | |
id: last-id | |
with: | |
gist_id: 9132dba40f4c806617043287a9f5d1e5 | |
file_name: this_week_in_rust.last_id | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: save latest id "${{ steps.last-id.outputs.content }}" to a file | |
run: echo "${{ steps.last-id.outputs.content }}" > /home/runner/work/this_week_in_rust.rs/this_week_in_rust.rs/this_week_in_rust.last_id | |
- name: login to docker.pkg.github.com | |
run: | | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin && \ | |
docker pull ghcr.io/sergeysova/this_week_in_rust.rs/main | |
- name: run crate to get digests and post to telegram | |
uses: ./ | |
with: | |
bot-token: ${{ secrets.BOT_TOKEN }} | |
chat-id: ${{ secrets.CHAT_ID }} | |
config-dir: /github/workspace/ | |
- name: read updated last-id | |
id: updated | |
run: echo "::set-output name=value::$(cat /home/runner/work/this_week_in_rust.rs/this_week_in_rust.rs/this_week_in_rust.last_id)" | |
- name: save last-id to gist | |
if: steps.last_id.outputs.content != steps.updated.outputs.value | |
uses: sergeysova/gist-write-action@v1 | |
with: | |
gist_id: 9132dba40f4c806617043287a9f5d1e5 | |
file_name: this_week_in_rust.last_id | |
content: ${{ steps.updated.outputs.value }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} |