-
-
Notifications
You must be signed in to change notification settings - Fork 307
41 lines (38 loc) · 1.17 KB
/
deploy.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
name: deploy to dockerHub
on:
push:
tags:
- "v*.*.*"
jobs:
create:
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v1
with:
draft: false
generate_release_notes: true
build:
needs: create
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: replace version
run: sed -i "s/SONIC_VERSION/${{ steps.previoustag.outputs.tag }}/g" index.html
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
- run: npm cache clear --force && npm install
- run: npm run build
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN }}" | docker login -u zhouyixun --password-stdin
- name: build docker image
run: docker build -t sonicorg/sonic-client-web:${{ steps.previoustag.outputs.tag }} .
- name: push docker image
run: docker push sonicorg/sonic-client-web:${{ steps.previoustag.outputs.tag }}