Skip to content

Commit

Permalink
separate get-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
wrynearson committed Mar 27, 2024
1 parent 8030d9f commit 56ce91a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 65 deletions.
44 changes: 40 additions & 4 deletions .github/workflows/deploy-gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,38 @@ env:
REACT_APP_AUTH_CODE: ${{ secrets.REACT_APP_AUTH_CODE }}

jobs:
auth:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}

- name: Cache auth
uses: actions/cache@v3
id: cache-auth
with:
path: credentials.json
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Install
run: npm install

- name: Fetch auth
run: node scripts/get-auth

build:
runs-on: ubuntu-latest

Expand All @@ -29,7 +61,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
# node-version-file: '.nvmrc'

- name: Cache node_modules
uses: actions/cache@v3
Expand All @@ -49,9 +80,14 @@ jobs:
uses: actions/cache@v3
id: cache-runs
with:
path: |
public/data/activities/transformed/**
credentials.json
path: public/data/activities/transformed/**
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Cache auth
uses: actions/cache@v3
id: cache-auth
with:
path: credentials.json
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Install
Expand Down
2 changes: 2 additions & 0 deletions scripts/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const getCredentials = require("./auth");
const transformActivity = require("./transform");

async function streamActivity(activities) {
await fs.ensureDir(`${__dirname}/../public/data/activities/transformed`);

console.log(
"Attempting to stream each activity from Strava that isn't already saved in the streamed folder."
);
Expand Down
7 changes: 7 additions & 0 deletions scripts/get-auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const getCredentials = require("./auth");

async function main() {
await getCredentials();
}

main();
60 changes: 0 additions & 60 deletions src/components/App_old.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "react-toastify/dist/ReactToastify.css";
*/ * {
* {
padding: 0rem;
margin: 0rem;
}
Expand Down

0 comments on commit 56ce91a

Please sign in to comment.