From 779464ffe3b13c6cbae8bfe8be91b5e383d8e9e9 Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Mon, 29 Jan 2024 15:05:36 -0800 Subject: [PATCH] Split into a new .yml --- .github/workflows/deploy-lambdas.yml | 52 ++++++++++++++++++++++++++++ .github/workflows/py-ci.yml | 45 ------------------------ 2 files changed, 52 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/deploy-lambdas.yml diff --git a/.github/workflows/deploy-lambdas.yml b/.github/workflows/deploy-lambdas.yml new file mode 100644 index 00000000000..ab43ea1cefe --- /dev/null +++ b/.github/workflows/deploy-lambdas.yml @@ -0,0 +1,52 @@ +name: Deploy lambdas to S3 and ECR + +on: + push: + branches: + - ci_deploy_lambdas + +jobs: + deploy-lambda: + strategy: + matrix: + path: + - access_counts + - es/indexer + - molecule + - pkgevents + - pkgpush + - pkgselect + - preview + - s3hash + - s3select + - status_reports + - tabular_preview + - thumbnail + - transcode + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build zip + run: | + BUILDER_IMAGE=quiltdata/lambda:build-3.8 + + zip_file=$(realpath "$(mktemp)") + function_dir=lambdas/${{ matrix.path }} + shared_dir=lambdas/shared + build_script=lambdas/build_zip.sh + + echo "Pulling latest $BUILDER_IMAGE from Docker Hub" + docker pull $BUILDER_IMAGE + + # require the :build tag so we can build aicsimageio, etc. + # see https://github.com/quiltdata/lambda/pull/2 + docker run --rm \ + --entrypoint /build_zip.sh \ + -v "$function_dir":/lambda/function:z \ + -v "$shared_dir":/lambda/shared:z \ + -v "$zip_file":/out.zip:z \ + -v "$build_script":/build_zip.sh:z \ + $BUILDER_IMAGE + + echo "Done running Docker..." + diff --git a/.github/workflows/py-ci.yml b/.github/workflows/py-ci.yml index 238053efbb2..1d99b7c0439 100644 --- a/.github/workflows/py-ci.yml +++ b/.github/workflows/py-ci.yml @@ -212,48 +212,3 @@ jobs: flags: lambda name: ${{ github.job }} env_vars: LAMBDA - deploy-lambda: - needs: test-lambda -# if: github.ref == 'refs/heads/master' - strategy: - matrix: - path: - - access_counts - - es/indexer - - molecule - - pkgevents - - pkgpush - - pkgselect - - preview - - s3hash - - s3select - - status_reports - - tabular_preview - - thumbnail - - transcode - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build zip - run: | - BUILDER_IMAGE=quiltdata/lambda:build-3.8 - - zip_file=$(realpath "$(mktemp)") - function_dir=lambdas/${{ matrix.path }} - shared_dir=lambdas/shared - build_script=lambdas/build_zip.sh - - echo "Pulling latest $BUILDER_IMAGE from Docker Hub" - docker pull $BUILDER_IMAGE - - # require the :build tag so we can build aicsimageio, etc. - # see https://github.com/quiltdata/lambda/pull/2 - docker run --rm \ - --entrypoint /build_zip.sh \ - -v "$function_dir":/lambda/function:z \ - -v "$shared_dir":/lambda/shared:z \ - -v "$zip_file":/out.zip:z \ - -v "$build_script":/build_zip.sh:z \ - $BUILDER_IMAGE - - echo "Done running Docker..."