Compare commits
No commits in common. "main" and "preprod" have entirely different histories.
@ -1,105 +0,0 @@
|
|||||||
name: CI/CD Pipeline for Spring Boot
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# Step 1: Checkout code
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Step 2: Set up JDK
|
|
||||||
- name: Set up JDK 23
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
java-version: 23
|
|
||||||
distribution: 'temurin'
|
|
||||||
|
|
||||||
# Step 3: Cache Maven dependencies
|
|
||||||
- name: Cache Maven Dependencies
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.m2
|
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-maven-
|
|
||||||
|
|
||||||
# Step 4: Build and test
|
|
||||||
- name: Build and Test
|
|
||||||
run: |
|
|
||||||
./mvnw clean verify
|
|
||||||
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [ build-and-test ]
|
|
||||||
steps:
|
|
||||||
- name: Install Docker
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y docker.io
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Download buildx
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.docker/cli-plugins
|
|
||||||
curl -sL https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
|
||||||
chmod +x ~/.docker/cli-plugins/docker-buildx
|
|
||||||
|
|
||||||
- name: Setup buildx
|
|
||||||
run: |
|
|
||||||
docker buildx create --use
|
|
||||||
docker buildx inspect --bootstrap
|
|
||||||
|
|
||||||
- name: Login to Cloud Coding Registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: rg.fr-par.scw.cloud/weworkstudio
|
|
||||||
username: nologin
|
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@master
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: rg.fr-par.scw.cloud/weworkstudio/xpeditis-backend:prod
|
|
||||||
build-args: |
|
|
||||||
XPEDITIS_PROFILE=prod
|
|
||||||
|
|
||||||
- name: Cleanup buildx
|
|
||||||
run: |
|
|
||||||
docker buildx rm
|
|
||||||
|
|
||||||
- name: Docker cleanup
|
|
||||||
run: docker system prune -af
|
|
||||||
|
|
||||||
- name: Uninstall Docker
|
|
||||||
run: |
|
|
||||||
apt-get purge -y docker.io
|
|
||||||
apt-get autoremove -y --purge docker.io
|
|
||||||
rm -rf /var/lib/docker /etc/docker
|
|
||||||
|
|
||||||
deploy_server:
|
|
||||||
name: Deploy - Docker - serveur
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [ docker ]
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Déclencher le Webhook
|
|
||||||
run: |
|
|
||||||
curl -X POST -H "Content-Type:application/json" -d '{"data": "example" }' ${{ secrets.WEBHOOK_URL }}
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
name: CI/CD Pipeline for Spring Boot Dev
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# Step 1: Checkout code
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Step 2: Set up JDK
|
|
||||||
- name: Set up JDK 23
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
java-version: 23
|
|
||||||
distribution: 'temurin'
|
|
||||||
|
|
||||||
# Step 3: Cache Maven dependencies
|
|
||||||
- name: Cache Maven Dependencies
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.m2
|
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-maven-
|
|
||||||
|
|
||||||
# Step 4: Build and test
|
|
||||||
- name: Build and Test
|
|
||||||
run: |
|
|
||||||
./mvnw clean verify
|
|
||||||
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [ build-and-test ]
|
|
||||||
steps:
|
|
||||||
- name: Install Docker
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y docker.io
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Download buildx
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.docker/cli-plugins
|
|
||||||
curl -sL https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
|
||||||
chmod +x ~/.docker/cli-plugins/docker-buildx
|
|
||||||
|
|
||||||
- name: Setup buildx
|
|
||||||
run: |
|
|
||||||
docker buildx create --use
|
|
||||||
docker buildx inspect --bootstrap
|
|
||||||
|
|
||||||
- name: Login to Cloud Coding Registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: rg.fr-par.scw.cloud/weworkstudio
|
|
||||||
username: nologin
|
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@master
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: rg.fr-par.scw.cloud/weworkstudio/xpeditis-backend:dev
|
|
||||||
build-args: |
|
|
||||||
XPEDITIS_PROFILE=dev
|
|
||||||
|
|
||||||
- name: Cleanup buildx
|
|
||||||
run: |
|
|
||||||
docker buildx rm
|
|
||||||
|
|
||||||
- name: Docker cleanup
|
|
||||||
run: docker system prune -af
|
|
||||||
|
|
||||||
- name: Uninstall Docker
|
|
||||||
run: |
|
|
||||||
apt-get purge -y docker.io
|
|
||||||
apt-get autoremove -y --purge docker.io
|
|
||||||
rm -rf /var/lib/docker /etc/docker
|
|
||||||
Loading…
Reference in New Issue
Block a user