Fetch Exchange Rate Dev #177
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: Fetch Exchange Rate Dev | |
on: | |
schedule: | |
- cron: "30 0 * * *" | |
workflow_dispatch: | |
branches: | |
- dev | |
- exchange-rate | |
inputs: | |
note: | |
description: 'Fetch Exchange Rate' | |
required: false | |
default: '' | |
concurrency: 'dev' | |
jobs: | |
exchange-rate: | |
if: "! startsWith(github.event.head_commit.message, '[CI Skip]')" | |
runs-on: ubuntu-22.04 | |
name: Fetch Exchange Rate | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: dev | |
fetch-depth: 0 | |
token: ${{ secrets.GH_AUTOMATION_TOKEN }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: | | |
yarn install | |
- name: Run scripts | |
run: | | |
EXCHANGE_RATE_API_KEY=${{ secrets.EXCHANGE_RATE_API_KEY }} yarn fetch-exchange-rate | |
- name: Commit changes | |
id: commit_changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: Github-Bot | |
author_email: [email protected] | |
message: '[CI Skip] Fetch Exchange Rate (dev)' | |
- name: Log commit changes | |
run: | | |
echo "pushed: ${{ steps.commit_changes.outputs.pushed }}" | |
- name: Deploy Assets to Cloudflare Pages | |
if: steps.commit_changes.outputs.pushed == 'true' | |
id: cloudflare_deployment | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: 'sw-static-cache' | |
gitHubToken: ${{ secrets.GH_AUTOMATION_TOKEN }} | |
branch: dev | |
directory: './data' | |
wranglerVersion: '3' |