-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a cron job to pull, modify, and publish a rss feed file every hour
- Loading branch information
1 parent
7274769
commit c548763
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Sync RSS Feed to S3 Buckets | ||
|
||
on: | ||
schedule: | ||
- cron: '0 * * * *' # Runs at the start of every hour | ||
|
||
jobs: | ||
sync-rss-feed: | ||
name: Sync RSS Feed | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Fetch and Modify RSS Feed | ||
run: | | ||
curl -s https://webflow.dev-ngrok.com/blog-post/rss.xml | sed 's/webflow.dev-ngrok.com/dev-ngrok.com/g' > dev-rss.xml | ||
curl -s https://webflow.stage-ngrok.com/blog-post/rss.xml | sed 's/webflow.stage-ngrok.com/stage-ngrok.com/g' > stage-rss.xml | ||
curl -s https://webflow.ngrok.com/blog-post/rss.xml | sed 's/webflow.ngrok.com/ngrok.com/g' > rss.xml | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
|
||
- name: Sync to Dev S3 Bucket | ||
run: aws s3 cp dev-rss.xml s3://docs-s3.dev-ngrok.com/docs/blog-post/rss.xml --acl public-read | ||
|
||
- name: Sync to Stage S3 Bucket | ||
run: aws s3 cp stage-rss.xml s3://docs-s3.stage-ngrok.com/docs/blog-post/rss.xml --acl public-read | ||
|
||
- name: Sync to Prod S3 Bucket | ||
run: aws s3 cp rss.xml s3://docs-s3.ngrok.com/docs/blog-post/rss.xml --acl public-read |
c548763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ngrok-docs – ./
ngrok-docs.vercel.app
ngrok-docs-git-main-ngrok-dev.vercel.app
ngrok-docs-ngrok-dev.vercel.app