-
-
Notifications
You must be signed in to change notification settings - Fork 4
113 lines (98 loc) · 3.41 KB
/
Copy pathdockerimage.yml
File metadata and controls
113 lines (98 loc) · 3.41 KB
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
name: sogeBot Dashboard UI
concurrency:
group: sogebot-dashboard-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # load full history
submodules: true
- name: Get short SHA
id: slug
run: echo "SHA=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- name: install node LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
check-latest: true
- name: Install latest npm
run: |
npm install -g npm
- name: Build a bot (dependency)
run: cd ./backend/ && make
- name: Build a UI
run: cd ./ui.admin-mui/ && npm install && REACT_APP_VERSION=$(git rev-parse HEAD) npm run build
- uses: actions/upload-artifact@v4
with:
name: sogeBot-dashboard-${{ steps.slug.outputs.SHA }}
path: ./ui.admin-mui/build/
- name: Build a UI (with old_commit basePath)
run: cd ./ui.admin-mui/ && node ./tools/changeHomepage.js ${{ steps.slug.outputs.SHA }} && npm install && REACT_APP_VERSION=$(git rev-parse HEAD) REACT_APP_COMMIT="${{ steps.slug.outputs.SHA }}" npm run build
- uses: actions/upload-artifact@v4
with:
name: sogeBot-dashboard-basePath-${{ steps.slug.outputs.SHA }}
path: ./ui.admin-mui/build
build:
needs: artifact
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Get short SHA
id: slug
run: echo "SHA=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.2.1
-
name: Login to DockerHub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- uses: actions/download-artifact@v4
with:
name: sogeBot-dashboard-${{ steps.slug.outputs.SHA }}
path: ${{ github.workspace }}/ui.admin-mui/sogeBot-dashboard-${{ steps.slug.outputs.SHA }}
- uses: actions/download-artifact@v4
with:
name: sogeBot-dashboard-basePath-${{ steps.slug.outputs.SHA }}
path: ${{ github.workspace }}/ui.admin-mui/sogeBot-dashboard-basePath-${{ steps.slug.outputs.SHA }}
- name: Display structure of downloaded files
run: ls -R
working-directory: ${{ github.workspace }}
- name: install node LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
check-latest: true
- name: Include older out build (test)
run: |
cd ${{ github.workspace }}/ui.admin-mui/ && sh download-old-commits.sh
-
name: Build and push
uses: docker/build-push-action@v3
with:
build-args: |
COMMIT=${{ steps.slug.outputs.SHA }}
context: ./ui.admin-mui/
file: ./ui.admin-mui/Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
sogebot/dashboard:latest
sogebot/dashboard:${{ steps.slug.outputs.SHA }}
no-cache: true