-
Notifications
You must be signed in to change notification settings - Fork 5
101 lines (74 loc) · 2.73 KB
/
release.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Release
# Controls when the action will run.
on:
push:
tags:
- 'v*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
with:
path: ui/
- name: Install dependencies
working-directory: ./ui
run: sudo npm install
- name: change hook
run: sed -i "s/#dev#/${{ steps.package-version.outputs.current-version}}/g" ui/src/components/app/App.js
- name: Create React Build
working-directory: ./ui
run: sudo npm run ojsbuild
- name: change css1
run: sudo sed -i "s/\/static\/css\/main\.[^=]*\.chunk\.css/\/static\/css\/main\.chunk\.css/g" ui/build/index.html
- name: change css2
run: sudo sed -i "s/\/static\/css\/2\.[^=]*\.chunk\.css/\/static\/css\/2\.chunk\.css/g" ui/build/index.html
- name: change js1
run: sudo sed -i "s/\/static\/js\/main\.[^=]*\.chunk\.js/\/static\/js\/main\.chunk\.js/g" ui/build/index.html
- name: change js2
run: sudo sed -i "s/\/static\/js\/2\.[^=]*\.chunk\.js/\/static\/js\/2\.chunk\.js/g" ui/build/index.html
- name: Zip Buiĺd folder
uses: papeloto/action-zip@v1
with:
files: ui/build
dest: build.zip
- name: Save build s Artifact for dest porposes
uses: actions/upload-artifact@v1
with:
name: build
path: ${{ github.workspace }}/build.zip
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.package-version.outputs.current-version}}"
title: "Release ${{ steps.package-version.outputs.current-version}}"
prerelease: false
files: |
${{ github.workspace }}/build.zip
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./ui
push: true
tags: o2rproject/ui:${{ steps.package-version.outputs.current-version}}