feat(lastpass): add integrations for lastpass (#159) #163
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: Deploy integration templates to S3 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: deploy-templates-to-s3-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
template-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
node-version-file: '.nvmrc' | |
- name: Install nango CLI | |
run: | | |
npm install nango -g | |
NANGO_CLI_UPGRADE_MODE=ignore nango version --debug | |
- name: Get specific changed files | |
if: github.event_name != 'workflow_dispatch' | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: | | |
integrations/* | |
integrations/**/* | |
- name: Resolve Aliases | |
run: npm run resolve:aliases | |
- name: Process and Upload changed directories to S3 | |
if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' | |
run: | | |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
echo "Manual trigger detected. Uploading all templates." | |
dirs=$(find integrations -maxdepth 1 -type d | tail -n +2) | |
else | |
echo "Automatic trigger detected. Uploading changed templates." | |
dirs=$(echo "${{ steps.changed-files-specific.outputs.all_changed_files }}" | cut -d'/' -f1,2 | sort -u) | |
fi | |
for dir in $dirs; do | |
integration=$(basename $dir) | |
mkdir -p /tmp/nango-temp/nango-integrations/$integration | |
cp $dir/nango.yaml /tmp/nango-temp/nango-integrations/ | |
cp -aL $dir/* /tmp/nango-temp/nango-integrations/$integration/ | |
cd /tmp/nango-temp/nango-integrations | |
npm install zod soap botbuilder | |
nango compile | |
cp -r dist/ $GITHUB_WORKSPACE/$dir/ | |
cp -r .nango/ $GITHUB_WORKSPACE/$dir/ | |
cd - | |
rm -rf /tmp/nango-temp | |
editedDir=$(echo "$dir" | sed 's/integrations/integration-templates/g') | |
aws s3 sync $dir s3://${{ secrets.AWS_BUCKET_NAME }}/$editedDir/ | |
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 }} |