-
Notifications
You must be signed in to change notification settings - Fork 20
63 lines (57 loc) · 2.17 KB
/
release-please.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "[release]: Release please"
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name:
run: |
echo ${{secrets.GITHUB_TOKEN}} | md5sum
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main
# The logic below handles the npm publication:
- name: Checkout Repository
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
if: ${{ steps.release.outputs.releases_created }}
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: npm ci
if: ${{ steps.release.outputs.releases_created }}
run: |
npm ci
# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
- name: Publish to NPM
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna publish from-package --no-push --no-private --yes
- name: "Docker: build & push"
if: ${{ steps.release.outputs['packages/ui--release_created'] }}
run: |
cd packages/ui
UI_IMAGE=$(npm run show:docker-image-name | tail -n 1)
UI_TAG=$(npm run show:version | tail -n 1)
TARGET_IMAGE=${UI_IMAGE}:${UI_TAG}
echo target image and tag: ${TARGET_IMAGE}
if ! docker pull ${TARGET_IMAGE} ; then
npm run docker:build --dockertag=${UI_TAG}
echo '${{ secrets.DOCKER_HUB_PASSWORD }}' | docker login --username ${{ secrets.DOCKER_HUB_LOGIN}} --password-stdin
npm run docker:push --dockertag=${UI_TAG}
docker tag ${TARGET_IMAGE} ${UI_IMAGE}:pre-stable
docker push ${UI_IMAGE}:pre-stable
else
echo Corresponding image already exists
fi