Skip to content

Commit dcdd5e3

Browse files
committed
Added trunk workfile which runs on pushes only to main
1 parent e9acc8d commit dcdd5e3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/trunk.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
name: Trunk CI
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build:
17+
uses: ./.github/workflows/workflow.yml
18+
with:
19+
python-version: '3.12'
20+
secrets:
21+
DB_USER: ${{ secrets.DB_USER }}
22+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
23+
DB_NAME: ${{ secrets.DB_NAME }}
24+
25+
release:
26+
name: Create Release Tag
27+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
28+
needs: build
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Create release tag
36+
env:
37+
GIT_TAG: "v$(date +'%Y.%m.%d.%H%M')"
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "github-actions[bot]@users.noreply.github.com"
41+
git tag $GIT_TAG
42+
git push origin $GIT_TAG

0 commit comments

Comments
 (0)