fix(api): handle 404 as json (#2085) #60
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
name: Upload integration templates to S3 | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
types: | |
- closed | |
concurrency: | |
group: templates-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
template-upload: | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install nango CLI | |
run: | | |
npm install -g nango | |
- name: Get specific changed files | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: | | |
integration-templates/* | |
integration-templates/**/* | |
- name: Process and Upload changed directories to S3 | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: | | |
wd=$(pwd) | |
for file in ${{ steps.changed-files-specific.outputs.all_changed_files }}; do | |
dir=$(dirname $file) | |
dir=${dir//\/syncs/} | |
dir=${dir//\/actions/} | |
mkdir -p /tmp/nango-temp/nango-integrations | |
cp -r $dir/* /tmp/nango-temp/nango-integrations/ | |
cd /tmp/nango-temp/nango-integrations | |
nango compile | |
cp -r dist/ $wd/$dir/ | |
cd - | |
rm -rf /tmp/nango-temp | |
aws s3 sync $dir s3://${{ secrets.AWS_BUCKET_NAME }}/$dir/ | |
done | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} |