update versions of sharp #10
This file contains hidden or 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: Build Layer ZIP | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| #schedule: | |
| #- cron: '0 0 * * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Variables | |
| id: vars | |
| run: | | |
| content=$(cat ./package-lock.json) | |
| sharp_version=$(echo $content | jq -r '.packages."node_modules/sharp".version') | |
| echo "sharp_version=$sharp_version" | |
| echo "sharp_version=$sharp_version" >> $GITHUB_OUTPUT | |
| release_exists="true" | |
| git show-ref --tags --quiet --verify -- "refs/tags/$sharp_version" || release_exists="false" | |
| echo "release_exists=$release_exists" | |
| echo "release_exists=$release_exists" >> $GITHUB_OUTPUT | |
| echo "sharp_version=$sharp_version" >> $GITHUB_OUTPUT | |
| - name: Build | |
| id: docker_build | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| tags: sharp-aws-lambda-layer:dev | |
| - name: Copy artifacts | |
| run: docker run -v "${{ github.workspace }}/dist":/dist sharp-aws-lambda-layer:dev | |
| - name: Create release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ steps.vars.outputs.sharp_version }} | |
| file: dist/sharp-layer.zip | |
| overwrite: true |