Skip to content

feat(nango.yaml): dedicated package, stricter parsing, wider types support #2329

feat(nango.yaml): dedicated package, stricter parsing, wider types support

feat(nango.yaml): dedicated package, stricter parsing, wider types support #2329

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)
echo "Changed files:"
echo "${{ steps.changed-files-specific.outputs.all_changed_files }}"
for file in ${{ steps.changed-files-specific.outputs.all_changed_files }}; do
dir=$(dirname $file)
parts=(${dir//\// })
if [ ${#parts[@]} -gt 1 ]; then
unset parts[-2]
fi
dir=$(IFS=/; echo "${parts[*]}")
integration=$(basename $dir)
mkdir -p /tmp/nango-temp/nango-integrations
cp $dir/nango.yaml /tmp/nango-temp/nango-integrations/
cp -r $dir/* /tmp/nango-temp/nango-integrations/$integration/
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 }}