Skip to content

Commit b154354

Browse files
committed
Client: create auto test pipelines
1 parent b6308e4 commit b154354

2 files changed

Lines changed: 159 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,83 @@
11
name: auto-test-and-document.yml
22
on:
3+
workflow_dispatch:
4+
# pull_request:
5+
# branches: [ "main" ]
6+
push:
7+
tags:
8+
- '**'
39

410
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
tag_suffix: ["", "-single-host"]
16+
include:
17+
- tag_suffix: ""
18+
path_name: ""
19+
- tag_suffix: "-single-host"
20+
path_name: "/seb-server-gui"
21+
22+
steps:
23+
- name: Set env for dynamic tag
24+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
25+
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}${{ matrix.tag_suffix }}" >> $GITHUB_ENV
26+
27+
- name: Set env manual
28+
if: github.event_name == 'workflow_dispatch'
29+
run: echo "TAG_NAME=default_version${{ matrix.tag_suffix }}" >> $GITHUB_ENV
30+
31+
- name: Checkout code
32+
uses: actions/checkout@v4.2.2
33+
34+
- name: Login to DockerHub
35+
uses: docker/login-action@v3.4.0
36+
with:
37+
username: naritter
38+
password: ${{ secrets.DOCKERHUB_PASSWORD}}
39+
40+
- name: Build and push Docker image
41+
uses: docker/build-push-action@v6.17.0
42+
with:
43+
context: .
44+
push: true
45+
tags: docker.io/naritter/seb-server-gui:${{ env.TAG_NAME }}
46+
build-args: VITE_SUB_PATH=${{ matrix.path_name }}
47+
48+
build-and-push-admin:
49+
runs-on: ubuntu-latest
50+
strategy:
51+
matrix:
52+
tag_suffix: [ "", "-single-host" ]
53+
include:
54+
- tag_suffix: ""
55+
path_name: ""
56+
- tag_suffix: "-single-host"
57+
path_name: "/seb-server-gui"
58+
59+
steps:
60+
- name: Set env for dynamic tag
61+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
62+
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}${{ matrix.tag_suffix }}" >> $GITHUB_ENV
63+
64+
- name: Set env manual
65+
if: github.event_name == 'workflow_dispatch'
66+
run: echo "TAG_NAME=default_version${{ matrix.tag_suffix }}" >> $GITHUB_ENV
67+
68+
- name: Checkout code
69+
uses: actions/checkout@v4.2.2
70+
71+
- name: Login to DockerHub
72+
uses: docker/login-action@v3.4.0
73+
with:
74+
username: ${{ secrets.DOCKERHUB_ADMIN_USERNAME }}
75+
password: ${{ secrets.DOCKERHUB_ADMIN_TOKEN }}
76+
77+
- name: Build and push Docker image
78+
uses: docker/build-push-action@v6.17.0
79+
with:
80+
context: .
81+
push: true
82+
tags: docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-server-gui:${{ env.TAG_NAME }}
83+
build-args: VITE_SUB_PATH=${{ matrix.path_name }}

.github/workflows/auto-test.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,84 @@
11
name: auto-test.yml
2+
23
on:
4+
workflow_dispatch:
5+
# pull_request:
6+
# branches: [ "main" ]
7+
push:
8+
tags:
9+
- '**'
310

411
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
tag_suffix: ["", "-single-host"]
17+
include:
18+
- tag_suffix: ""
19+
path_name: ""
20+
- tag_suffix: "-single-host"
21+
path_name: "/seb-server-gui"
22+
23+
steps:
24+
- name: Set env for dynamic tag
25+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
26+
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}${{ matrix.tag_suffix }}" >> $GITHUB_ENV
27+
28+
- name: Set env manual
29+
if: github.event_name == 'workflow_dispatch'
30+
run: echo "TAG_NAME=default_version${{ matrix.tag_suffix }}" >> $GITHUB_ENV
31+
32+
- name: Checkout code
33+
uses: actions/checkout@v4.2.2
34+
35+
- name: Login to DockerHub
36+
uses: docker/login-action@v3.4.0
37+
with:
38+
username: naritter
39+
password: ${{ secrets.DOCKERHUB_PASSWORD}}
40+
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@v6.17.0
43+
with:
44+
context: .
45+
push: true
46+
tags: docker.io/naritter/seb-server-gui:${{ env.TAG_NAME }}
47+
build-args: VITE_SUB_PATH=${{ matrix.path_name }}
48+
49+
build-and-push-admin:
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
tag_suffix: [ "", "-single-host" ]
54+
include:
55+
- tag_suffix: ""
56+
path_name: ""
57+
- tag_suffix: "-single-host"
58+
path_name: "/seb-server-gui"
59+
60+
steps:
61+
- name: Set env for dynamic tag
62+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
63+
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}${{ matrix.tag_suffix }}" >> $GITHUB_ENV
64+
65+
- name: Set env manual
66+
if: github.event_name == 'workflow_dispatch'
67+
run: echo "TAG_NAME=default_version${{ matrix.tag_suffix }}" >> $GITHUB_ENV
68+
69+
- name: Checkout code
70+
uses: actions/checkout@v4.2.2
71+
72+
- name: Login to DockerHub
73+
uses: docker/login-action@v3.4.0
74+
with:
75+
username: ${{ secrets.DOCKERHUB_ADMIN_USERNAME }}
76+
password: ${{ secrets.DOCKERHUB_ADMIN_TOKEN }}
77+
78+
- name: Build and push Docker image
79+
uses: docker/build-push-action@v6.17.0
80+
with:
81+
context: .
82+
push: true
83+
tags: docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-server-gui:${{ env.TAG_NAME }}
84+
build-args: VITE_SUB_PATH=${{ matrix.path_name }}

0 commit comments

Comments
 (0)