-
Notifications
You must be signed in to change notification settings - Fork 30
47 lines (44 loc) · 1.36 KB
/
docker-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build Layer ZIP
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Read version
id: package_lock_json
run: |
content=$(cat ./package-lock.json)
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
echo "::set-output name=packageLockJson::$content"
- name: Variables
id: vars
run: |
sharp_version="${{ fromJSON(steps.package_lock_json.outputs.packageLockJson).dependencies.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" >> $GITHUB_OUTPUT
- name: Build
run: npm ci --arch=x64 --platform=linux
- 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