skip upload steps on CI (#1)

This commit is contained in:
Jacob Heider 2022-10-26 08:16:43 -04:00 committed by GitHub
parent 89bb6bf292
commit e1d2ab4f47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 1 deletions

View file

@ -5,6 +5,10 @@ on:
projects: projects:
required: true required: true
type: string type: string
upload:
required: false
type: boolean
default: false
jobs: jobs:
build: build:
@ -197,6 +201,7 @@ jobs:
- name: upload bottles - name: upload bottles
id: upload id: upload
if: ${{ inputs.upload }}
run: pantry/scripts/upload.ts run: pantry/scripts/upload.ts
--pkgs ${{ needs.build.outputs.built }} ${{ needs.build.outputs.built }} --pkgs ${{ needs.build.outputs.built }} ${{ needs.build.outputs.built }}
--srcs ${{ needs.build.outputs.srcs }} ${{ needs.build.outputs.srcs }} --srcs ${{ needs.build.outputs.srcs }} ${{ needs.build.outputs.srcs }}
@ -210,6 +215,7 @@ jobs:
#NOTE ideally wed invalidate all at once so this is atomic #NOTE ideally wed invalidate all at once so this is atomic
# however GHA cant consolidate outputs from a matrix :/ # however GHA cant consolidate outputs from a matrix :/
- uses: chetan/invalidate-cloudfront-action@v2 - uses: chetan/invalidate-cloudfront-action@v2
if: ${{ inputs.upload }}
env: env:
PATHS: ${{ steps.upload.outputs.cf-invalidation-paths }} PATHS: ${{ steps.upload.outputs.cf-invalidation-paths }}
DISTRIBUTION: ${{ secrets.AWS_CF_DISTRIBUTION_ID }} DISTRIBUTION: ${{ secrets.AWS_CF_DISTRIBUTION_ID }}

View file

@ -15,3 +15,21 @@ jobs:
jq -sc . | jq -sc . |
curl https://app.tea.xyz/api/receiveWatcherProjects --fail -X PUT \ curl https://app.tea.xyz/api/receiveWatcherProjects --fail -X PUT \
-H "content-type: application/json" -H "authorization: bearer ${{ secrets.TEA_API_TOKEN }}" -d @- -H "content-type: application/json" -H "authorization: bearer ${{ secrets.TEA_API_TOKEN }}" -d @-
get-diff:
runs-on: ubuntu-latest
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
id: diff
with:
PATTERNS: projects/**/package.yml
build:
needs: [get-diff]
uses: ./.github/workflows/build.yml
with:
projects: ${{ needs.get-diff.outputs.diff }}
upload: true
secrets: inherit
if: ${{ needs.get-diff.outputs.diff != '' }}

View file

@ -13,4 +13,5 @@ jobs:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
projects: ${{ inputs.projects }} projects: ${{ inputs.projects }}
upload: true
secrets: inherit secrets: inherit

View file

@ -22,3 +22,4 @@ test:
test "$OUT" = "$INPUT" test "$OUT" = "$INPUT"
env: env:
INPUT: Hello, World! INPUT: Hello, World!