This repository was archived by the owner on Aug 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (114 loc) · 3.69 KB
/
build-production.yml
File metadata and controls
146 lines (114 loc) · 3.69 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# This is a basic workflow to help you get started with Actions
name: Push Maven realease
on:
release:
types: [created]
workflow_dispatch:
jobs:
publish-maven-package:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: import_gpg
name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Maven settings
run: |
mkdir -p $HOME/.m2
cp .github/settings.xml $HOME/.m2/settings.xml
- name: Publish to the Maven Central Repository
run: mvn --batch-mode clean deploy -T 6
env:
MAVEN_USERNAME: ${{ secrets.FUNIXPROD_MVN_REPO_USER }}
MAVEN_PASSWORD: ${{ secrets.FUNIXPROD_MVN_REPO_TOKEN }}
build-production-maven:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
- id: import_gpg
name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn --batch-mode clean package -T 6
- name: Publish Package Artifacts
uses: actions/upload-artifact@v4
with:
name: maven-packages
path: modules/**/target/*.jar
build-production-docker-images:
needs: build-production-maven
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Checkout source code
uses: actions/checkout@v4
- name: Download Package Artifacts
uses: actions/download-artifact@v5
with:
name: maven-packages
path: modules
- name: Build funixgaming api docker images and push
env:
IMAGE_TAG: latest
run: chmod +x ./build-images.sh && ./build-images.sh
update-kubernetes-cluster:
needs:
- build-production-docker-images
runs-on:
- self-hosted
- k3s-funixproductions
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Update Kubernetes Cluster
run: cd kubernetes && chmod +x ./deployServices.sh && ./deployServices.sh
send-success-build-discord-notif:
needs:
- update-kubernetes-cluster
runs-on: ubuntu-latest
steps:
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CI_STATUS }}
DISCORD_USERNAME: FunixGaming-API-Deploy
DISCORD_AVATAR: https://avatars.githubusercontent.com/u/99349214?s=200&v=4
uses: Ilshidur/action-discord@master
with:
args: '✅ FunixGaming-API 🌍️**PROD** (api.funixgaming.fr) a bien été déployé sur le cluster Kubernetes !'