mirror of
https://github.com/davegallant/rfd-notify.git
synced 2025-08-13 11:40:20 +00:00
Compare commits
3 Commits
12e2b39dcd
...
7b17831900
Author | SHA1 | Date | |
---|---|---|---|
|
7b17831900 | ||
|
0a7196636b | ||
|
c47fc6fc84 |
80
README.md
80
README.md
@@ -44,9 +44,7 @@ expressions:
|
|||||||
- price error
|
- price error
|
||||||
```
|
```
|
||||||
|
|
||||||
## Github 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.
|
||||||
|
|
||||||
@@ -56,35 +54,33 @@ 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:
|
||||||
rfd_notify:
|
rfd_notify:
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: rfd-notify
|
name: rfd-notify
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
id: cache
|
||||||
|
with:
|
||||||
|
path: previous_matches
|
||||||
|
key: previous-matches
|
||||||
- name: Run rfd-notify
|
- name: Run rfd-notify
|
||||||
uses: davegallant/rfd-notify@main
|
uses: davegallant/rfd-notify@main
|
||||||
env:
|
env:
|
||||||
APPRISE_URL: ${{ secrets.APPRISE_URL }}
|
APPRISE_URL: ${{ secrets.APPRISE_URL }}
|
||||||
|
- name: update cache on every commit
|
||||||
- name: Commit files
|
uses: actions/cache@v3
|
||||||
run: |
|
|
||||||
git config --local user.email "action@github.com"
|
|
||||||
git config --local user.name "RFD Notify"
|
|
||||||
git add previous_matches
|
|
||||||
git commit -m "Update previous_matches" -a || true
|
|
||||||
|
|
||||||
- name: Push changes
|
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
path: previous_matches
|
||||||
branch: ${{ github.ref }}
|
key: previous-matches-${{ runner.os }}-${{ gitea.run_id }} # Can use time based key as well
|
||||||
|
restore-keys: |
|
||||||
|
previous-matches
|
||||||
```
|
```
|
||||||
|
|
||||||
## Gitlab Pipelines
|
## Gitlab Pipelines
|
||||||
@@ -109,51 +105,3 @@ run:
|
|||||||
- python /app/rfd_notify/cli.py -c config.yml
|
- python /app/rfd_notify/cli.py -c config.yml
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Jenkins
|
|
||||||
|
|
||||||
> The necessary Jenkins plugins (such as docker) and credentials must be configured.
|
|
||||||
|
|
||||||
Using a declarative pipeline, run the build every minute, and store the previous matches in the workspace:
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
|
|
||||||
triggers {
|
|
||||||
cron('* * * * *')
|
|
||||||
}
|
|
||||||
|
|
||||||
options {
|
|
||||||
buildDiscarder(
|
|
||||||
logRotator(
|
|
||||||
numToKeepStr: '25',
|
|
||||||
artifactNumToKeepStr: '25'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
disableConcurrentBuilds()
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Run rfd-notify') {
|
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'ghcr.io/davegallant/rfd-notify:1'
|
|
||||||
args '--entrypoint='
|
|
||||||
reuseNode true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
withCredentials([string(credentialsId: 'apprise-url', variable: 'APPRISE_URL')]) {
|
|
||||||
sh 'python /app/rfd_notify/cli.py -c config.yml'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Archive previous_matches') {
|
|
||||||
steps {
|
|
||||||
archiveArtifacts artifacts: 'previous_matches'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
Reference in New Issue
Block a user