Skip to content

Commit f0a53b0

Browse files
committed
feat(.github/workflows): Add new workflow for PR checks and modify existing flow [no ci]
1 parent 221843a commit f0a53b0

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

.github/workflows/flow.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
8-
branches:
9-
- '**'
7+
108

119
jobs:
1210
frontend:

.github/workflows/pr.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Check Pr
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build:
10+
name: Build Frontend
11+
runs-on: [ self-hosted ]
12+
outputs:
13+
version: "${{ steps.version.outputs.version }}"
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Print Event
20+
run: |
21+
echo "Event Name: ${{ github.event_name }}"
22+
echo "Repository: ${{ github.repository }}"
23+
echo "SHA: ${{ github.sha }}"
24+
echo "Ref: ${{ github.ref }}"
25+
echo "Action: ${{ github.action }}"
26+
echo "Actor: ${{ github.actor }}"
27+
echo "Workflow Run ID: ${{ github.run_id }}"
28+
echo "Head Repository: ${{ github.head_repository }}"
29+
echo "Base Repository: ${{ github.base_repository }}"
30+
31+
- name: Get version
32+
id: version
33+
run: |
34+
if [[ -n "$GITHUB_REF" && "$GITHUB_REF" == "refs/tags/"* ]]; then
35+
echo "tag version"
36+
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
37+
else
38+
echo "commit version"
39+
echo "::set-output name=version::${{ github.sha }}"
40+
fi
41+
42+
- name: Build and Push GitDataWeb
43+
run: |
44+
docker build -t gitdatateam/gitdataweb:${{ steps.version.outputs.version }} .
45+
docker rmi $(docker images -f "dangling=true" -q)
46+

0 commit comments

Comments
 (0)