-
Notifications
You must be signed in to change notification settings - Fork 390
86 lines (75 loc) · 2.61 KB
/
docker-enterprise.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Docker Enterprise
on:
workflow_run:
workflows: [Release NPM]
types:
- completed
push:
branches:
- 'release/**'
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set Current Version
run: |
STEEDOS_VERSION=$(node -p 'require("./lerna.json").version')
echo "STEEDOS_VERSION=${STEEDOS_VERSION}" >> $GITHUB_ENV
echo "STEEDOS_VERSION=${STEEDOS_VERSION}"
- name: Generate info.json
run: |
if [[ -f deploy/enterprise/scripts/generate_info_json.sh ]]; then
deploy/enterprise/scripts/generate_info_json.sh
fi
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
steedos/steedos-enterprise
252208178451.dkr.ecr.cn-northwest-1.amazonaws.com.cn/dockerhub/steedos/steedos-enterprise
tags: |
type=semver,pattern={{version}},value=${{ env.STEEDOS_VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.STEEDOS_VERSION }}
type=semver,pattern={{major}},value=${{ env.STEEDOS_VERSION }}
- uses: docker/login-action@v1
name: Login Docker Hub
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_NINGXIA }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_NINGXIA }}
aws-region: cn-northwest-1
-
name: Login to ECR
uses: docker/login-action@v2
with:
registry: 252208178451.dkr.ecr.cn-northwest-1.amazonaws.com.cn
- name: Replace Version ~2.5 to Tag
uses: jacobtomlinson/gha-find-replace@v2
with:
include: deploy/enterprise/app/platform/package.json
find: "~2.5"
replace: ${{env.STEEDOS_VERSION}}
regex: false
- name: Build and push docker
uses: docker/build-push-action@v3
with:
context: ./deploy/enterprise
platforms: linux/amd64 #,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}