-
Notifications
You must be signed in to change notification settings - Fork 150
130 lines (109 loc) · 3.6 KB
/
publish-packages.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Publish NPM Packages
on:
push:
tags:
- '*'
jobs:
publish-packages:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
- name: Configure CI Git User
run: |
git config --global user.name 'Rajat Saxena'
git config --global user.email '[email protected]'
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/codelitdev/courselit
env:
GITHUB_PAT: ${{ secrets.PAT }}
- name: Checkout and pull branch
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $LATEST_TAG
- name: Install Packages
run: yarn install
- name: Authenticate with Registry
run: |
yarn npm logout
echo "npmAuthToken: $NPM_TOKEN" >> .yarnrc.yml
yarn npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM }}
- name: Build packages
run: |
yarn workspace @courselit/icons build
yarn workspace @courselit/common-models build
yarn workspace @courselit/utils build
yarn workspace @courselit/text-editor build
yarn workspace @courselit/state-management build
yarn workspace @courselit/components-library build
yarn workspace @courselit/common-widgets build
- name: Publish package
run: |
yarn publish
env:
GH_TOKEN: ${{ secrets.PAT }}
GITHUB_TOKEN: ${{ secrets.PAT }}
NPM_TOKEN: ${{ secrets.NPM }}
publish-docker-images:
needs: publish-packages
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
- name: Checkout and pull branch
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $LATEST_TAG
- name: Setup buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERNAME }}
password: ${{ secrets.DOCKERTOKEN }}
- name: Docker meta for the app
id: metaapp
uses: docker/metadata-action@v3
with:
images: codelit/courselit-app
- name: Docker meta for the proxy
id: metaproxy
uses: docker/metadata-action@v3
with:
images: codelit/courselit-proxy
- name: Docker meta for the queue
id: metaqueue
uses: docker/metadata-action@v3
with:
images: codelit/courselit-queue
- name: Build and push app
id: docker_build_app
uses: docker/build-push-action@v2
with:
context: .
file: ./services/app/Dockerfile
push: true
tags: ${{ steps.metaapp.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build_app.outputs.digest }}
- name: Build and push proxy
id: docker_build_proxy
uses: docker/build-push-action@v2
with:
context: .
file: ./services/proxy/Dockerfile
push: true
tags: ${{ steps.metaproxy.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build_proxy.outputs.digest }}
- name: Build and push queue
id: docker_build_queue
uses: docker/build-push-action@v2
with:
context: .
file: ./services/queue/Dockerfile
push: true
tags: ${{ steps.metaqueue.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build_queue.outputs.digest }}