2 Commits

Author SHA1 Message Date
Dave Gallant
12e2b39dcd Add git push with checkout@v4 2023-12-09 20:09:05 -05:00
Dave Gallant
e60fcf2a53 Update README.md 2023-12-09 15:45:10 -05:00

View File

@@ -28,8 +28,8 @@ poetry run python rfd_notify/cli.py -c examples/config.yml
The following environment variables are required: The following environment variables are required:
| VARIABLE | DESCRIPTION | | VARIABLE | DESCRIPTION |
| ----------- | ---------------------------------------------------------------- | | ----------- | ---------------------------------------------------------------------------------------- |
| APPRISE_URL | See [notifications](https://github.com/caronc/apprise#productivity-based-notifications). | | APPRISE_URL | See [notifications](https://github.com/caronc/apprise#productivity-based-notifications). |
## Example Configuration ## Example Configuration
@@ -46,6 +46,8 @@ expressions:
## Github Actions (and Gitea Actions) ## Github Actions (and Gitea Actions)
> Commiting the pickled data (previous_matches) back into the repository is a bit of a hack, but allows for a simpler setup.
An action can be setup to scan for deals, send a notification and store previously found deals in the repo. An action can be setup to scan for deals, send a notification and store previously found deals in the repo.
It also requires the corresponding [encrypted secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets) setup. It also requires the corresponding [encrypted secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets) setup.
@@ -54,7 +56,6 @@ It also requires the corresponding [encrypted secrets](https://docs.github.com/e
# .github/workflows/rfd-notify.yml # .github/workflows/rfd-notify.yml
on: on:
push:
schedule: schedule:
- cron: "*/5 * * * *" - cron: "*/5 * * * *"
jobs: jobs:
@@ -62,25 +63,18 @@ jobs:
name: rfd-notify name: rfd-notify
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 sparse-checkout: |
- uses: actions/cache@v3 config.yml
id: cache previous_matches
with: - name: Commit and push changes
path: previous_matches run: |
key: previous-matches git config --local user.email "bot@gitea.snake-cloud.ts.net"
- name: Run rfd-notify git config --local user.name "RFD Notify"
uses: davegallant/rfd-notify@main git add previous_matches
env: git commit -m "Update previous_matches" -a || true
APPRISE_URL: ${{ secrets.APPRISE_URL }} git push
- name: update cache on every commit
uses: actions/cache@v3
with:
path: previous_matches
key: previous-matches-${{ runner.os }}-${{ gitea.run_id }} # Can use time based key as well
restore-keys: |
previous-matches
``` ```
## Gitlab Pipelines ## Gitlab Pipelines
@@ -103,5 +97,4 @@ run:
- previous_matches - previous_matches
script: script:
- python /app/rfd_notify/cli.py -c config.yml - python /app/rfd_notify/cli.py -c config.yml
``` ```