From 171f819efa920d19c03a11b75481b2bdef150efd Mon Sep 17 00:00:00 2001 From: Shajia Abidi Date: Mon, 19 Aug 2024 15:20:16 -0700 Subject: [PATCH] Optimize GitHub actions (#34) * reverse ga * update github actions --------- Co-authored-by: Shajia Abidi --- .github/workflows/tabs-schedule.yml | 63 +++++++++-------------------- 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/.github/workflows/tabs-schedule.yml b/.github/workflows/tabs-schedule.yml index 8a923c8..8563214 100644 --- a/.github/workflows/tabs-schedule.yml +++ b/.github/workflows/tabs-schedule.yml @@ -1,49 +1,24 @@ name: AP Tabulation and Race Call Statuses -on: +on: schedule: - - cron: "*/15 * * * *" - -jobs: -# runEndpoint: -# runs-on: ubuntu-latest -# container: "node:20" -# if: github.event.schedule != '*/15 * * * *' -# outputs: -# output1: ${{ steps.step1.outputs.bool }} -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# - name: Install Dependencies -# run: npm install -# - name: Run Code -# id: step1 -# env: -# SHEETS_ID: ${{secrets.SHEETS_ID}} -# GOOGLE_CREDENTIALS: ${{secrets.GOOGLE_CREDENTIALS}} -# run: | -# shouldRunEndpoint=$(node elex-tabulation-data/main.js) -# echo $shouldRunEndpoint -# echo "bool=$shouldRunEndpoint" >> $GITHUB_OUTPUT - + - cron: "*/20 * * * *" -# Do I hve to checkout and install again? +jobs: job2: - runs-on: ubuntu-latest - needs: runEndpoint - # if: needs.runEndpoint.outputs.output1 == 'true' && github.event.schedule != '52 11 * * *' - container: "node:20" - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install Dependencies - run: npm install - - name: Run Code - env: - SHEETS_ID: ${{secrets.SHEETS_ID}} - SLACK_TOKEN: ${{secrets.SLACK_TOKEN}} - AP_API_KEY: ${{secrets.AP_API_KEY}} - GOOGLE_CREDENTIALS: ${{secrets.GOOGLE_CREDENTIALS}} - run: | - # echo ${{needs.runEndpoint.outputs.output1}} - node elex-tabulation-data/index.js + runs-on: ubuntu-latest + container: "node:20" + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Dependencies + run: npm install + - name: Run Code + env: + SHEETS_ID: ${{secrets.SHEETS_ID}} + SLACK_TOKEN: ${{secrets.SLACK_TOKEN}} + AP_API_KEY: ${{secrets.AP_API_KEY}} + GOOGLE_CREDENTIALS: ${{secrets.GOOGLE_CREDENTIALS}} + run: | + # echo ${{needs.runEndpoint.outputs.output1}} + node elex-tabulation-data/index.js