diff --git a/.github/workflows/update-rss.yml b/.github/workflows/update-rss.yml index 7d4f3ed..1add039 100644 --- a/.github/workflows/update-rss.yml +++ b/.github/workflows/update-rss.yml @@ -9,20 +9,33 @@ on: - cron: "0 0 * * *" # Run every day at midnight jobs: - build: + generate-rss: runs-on: ubuntu-latest + permissions: + contents: 'read' + id-token: 'write' + steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: '21' - name: Run Script - run: node run.js + run: node src/run.js - - name: List Directory - run: ls -l + - id: 'auth-to-gcloud' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' + + - id: 'upload-rss-file' + uses: 'google-github-actions/upload-cloud-storage@v2' + with: + path: 'rss.xml' + destination: 'miljobilen-rss' + process_gcloudignore: false diff --git a/README.md b/README.md index 9c3ea18..dfda073 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,10 @@ Runs every day and checks for and updates RSS with next pickup date relative to This is such a shitshow. Smaller tasks: - - [ ] Connect to Google bucket, SA, etc. + - [x] Connect to Google bucket, SA, etc. - [ ] Updates RSS generation + - [ ] Compare existing dates in RSS to fetched + - [ ] alert on failing run ### Handle rollover of date list diff --git a/rss.js b/src/rss.js similarity index 99% rename from rss.js rename to src/rss.js index d4723b2..ef1bd48 100644 --- a/rss.js +++ b/src/rss.js @@ -8,7 +8,7 @@ class RSS { this.filename = 'rss.xml'; this.feed = null; - this.read() + // this.read() } // reads RSS file diff --git a/run.js b/src/run.js similarity index 100% rename from run.js rename to src/run.js diff --git a/utils.js b/src/utils.js similarity index 100% rename from utils.js rename to src/utils.js