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:
required: true
type: string
upload:
required: false
type: boolean
default: false
jobs:
build:
@ -197,6 +201,7 @@ jobs:
- name: upload bottles
id: upload
if: ${{ inputs.upload }}
run: pantry/scripts/upload.ts
--pkgs ${{ needs.build.outputs.built }} ${{ needs.build.outputs.built }}
--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
# however GHA cant consolidate outputs from a matrix :/
- uses: chetan/invalidate-cloudfront-action@v2
if: ${{ inputs.upload }}
env:
PATHS: ${{ steps.upload.outputs.cf-invalidation-paths }}
DISTRIBUTION: ${{ secrets.AWS_CF_DISTRIBUTION_ID }}

View file

@ -15,3 +15,21 @@ jobs:
jq -sc . |
curl https://app.tea.xyz/api/receiveWatcherProjects --fail -X PUT \
-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
with:
projects: ${{ inputs.projects }}
upload: true
secrets: inherit

View file

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