fetch-data #1108
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-data | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
fetch-weather: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' | |
- name: Cache dependencies | |
uses: actions/cache@v3.0.1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: install dependencies | |
run: yarn install | |
- name: get forecast | |
id: forecast | |
uses: ./.github/actions/forecast | |
with: | |
location: 331470 | |
api-key: ${{ secrets.ACCU_WEATHER_API_KEY }} | |
- name: write sunrise | |
id: write-sunrise | |
uses: ./.github/actions/write-property | |
with: | |
key: 'sunrise' | |
value: ${{ steps.forecast.outputs.sunrise }} | |
- name: write sunset | |
id: write-sunset | |
uses: ./.github/actions/write-property | |
with: | |
key: 'sunset' | |
value: ${{ steps.forecast.outputs.sunset }} | |
- name: write icon | |
id: write-icon | |
uses: ./.github/actions/write-property | |
with: | |
key: 'icon' | |
value: ${{ steps.forecast.outputs.icon }} | |
- name: write iconPhrase | |
id: write-icon-phrase | |
uses: ./.github/actions/write-property | |
with: | |
key: 'iconPhrase' | |
value: ${{ steps.forecast.outputs.iconPhrase }} | |
- name: write cloudCover | |
id: write-cloud-cover | |
uses: ./.github/actions/write-property | |
with: | |
key: 'cloudCover' | |
value: ${{ steps.forecast.outputs.cloudCover }} | |
- name: write moonPhase | |
id: write-moon-phase | |
uses: ./.github/actions/write-property | |
with: | |
key: 'moonPhase' | |
value: ${{ steps.forecast.outputs.moonPhase }} | |
- name: write moonRise | |
id: write-moon-rise | |
uses: ./.github/actions/write-property | |
with: | |
key: 'moonRise' | |
value: ${{ steps.forecast.outputs.moonRise }} | |
- name: write moonSet | |
id: write-moon-set | |
uses: ./.github/actions/write-property | |
with: | |
key: 'moonSet' | |
value: ${{ steps.forecast.outputs.moonSet }} | |
- name: build | |
run: yarn build -- --prefix-paths | |
- name: deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
# fetch-top-tracks: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# - name: Setup | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: '14' | |
# - name: Cache dependencies | |
# uses: actions/cache@v3.0.1 | |
# with: | |
# path: ~/.npm | |
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
# restore-keys: | | |
# ${{ runner.os }}-node- | |
# - name: install dependencies | |
# run: yarn install | |
# - name: get top tracks | |
# id: top-tracks | |
# uses: ./.github/actions/top-tracks | |
# with: | |
# time_range: 'short_term' | |
# client_id: ${{ secrets.SPOTIFY_ID }} | |
# client_secret: ${{ secrets.SPOTIFY_SECRET }} |