-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
323 additions
and
190 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Upload assets | ||
|
||
on: | ||
# pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
region: | ||
type: string | ||
description: 'Restrict packaging for a single region' | ||
required: true | ||
workflow_call: | ||
inputs: | ||
region: | ||
type: string | ||
description: 'Restrict packaging for a single region' | ||
required: true | ||
|
||
env: | ||
SAM_CLI_TELEMETRY: 0 | ||
|
||
jobs: | ||
permission_check: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
can-write: ${{ steps.check.outputs.can-write }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
steps: | ||
- id: check | ||
run: | | ||
# If the AWS_ACCESS_KEY_ID secret is MIA we can't run tests | ||
if [[ -z "$AWS_ACCESS_KEY_ID" ]]; then | ||
echo "can-write=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "can-write=true" >> $GITHUB_OUTPUT | ||
fi | ||
upload: | ||
needs: [permission_check] | ||
if: needs.permission_check.outputs.can-write == 'true' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Fetch tags for versioning | ||
# TODO: skip if version is passed in | ||
run: git fetch --prune --unshallow --tags | ||
|
||
- name: Setup AWS credentials | ||
uses: aws-actions/[email protected] | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | ||
aws-region: us-west-2 | ||
|
||
- name: AWS Info | ||
run: aws sts get-caller-identity | ||
|
||
- name: Build and upload SAM apps | ||
run: | | ||
make sam-upload${{ inputs.region && '-' }}${{ inputs.region }} | ||
env: | ||
MAKEFLAGS: "-j 8" | ||
S3_BUCKET_PREFIX: "observeinc-" |
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
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
Oops, something went wrong.