-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Goulven.Furet
authored and
Goulven.Furet
committed
Jan 2, 2024
1 parent
e7b3002
commit dde781c
Showing
7 changed files
with
239 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This workflow will trigger the remote ssh script to restart infrastructure with the latest artefacts version | ||
on: workflow_dispatch | ||
|
||
name: Publish latest infrastructure on qualification environment | ||
|
||
jobs: | ||
deploy: | ||
name: publish-infra-beta | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Publish via ssh | ||
uses: appleboy/ssh-action@v1.0.2 | ||
with: | ||
host: ${{ secrets.REMOTE_BETA_HOST }} | ||
username: ${{ secrets.REMOTE_BETA_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY}} | ||
script: sh /opt/open4goods/bin/publish-infra.sh | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This workflow will trigger the remote ssh script to | ||
# restart application with the latest artefacts version | ||
on: workflow_dispatch | ||
|
||
name: Restart applications on qualification environment | ||
|
||
jobs: | ||
deploy: | ||
name: publish-jars-beta | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Publish via ssh | ||
uses: appleboy/ssh-action@v1.0.2 | ||
with: | ||
host: ${{ secrets.REMOTE_BETA_HOST }} | ||
username: ${{ secrets.REMOTE_BETA_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY}} | ||
script: sh /opt/open4goods/bin/publish-jars.sh | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
on: workflow_dispatch | ||
name: release-deploy-prod | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
|
||
- uses: actions/checkout@v4 | ||
|
||
############################################ | ||
# Install Java | ||
########################################### | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'adopt' | ||
cache: maven | ||
|
||
|
||
############################################ | ||
# Build jars | ||
########################################### | ||
|
||
- name: Build jars with Maven | ||
run: mvn --batch-mode --update-snapshots install -Dmaven.test.skip=true | ||
|
||
############################################ | ||
# Build maven site | ||
########################################### | ||
|
||
- name: Build Maven site | ||
run: mvn --batch-mode clean site site:stage scm-publish:publish-scm | ||
|
||
|
||
############################################ | ||
# Build the changelogs | ||
########################################### | ||
|
||
- name: Build Changelog | ||
id: github_release | ||
uses: mikepenz/release-changelog-builder-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
############################################ | ||
# Create the release | ||
########################################### | ||
|
||
- name: Create Release | ||
uses: mikepenz/action-gh-release@v0.2.0-a03 #softprops/action-gh-release | ||
with: | ||
body: ${{steps.github_release.outputs.changelog}} | ||
|
||
|
||
|
||
############################################ | ||
# Deploy API to production server | ||
########################################### | ||
|
||
- name: Deploy API to server | ||
uses: easingthemes/ssh-deploy@main | ||
env: | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ARGS: "-rltgoDzvO --delete" | ||
SOURCE: "/api/target/api-0.0.1-SNAPSHOT.jar" | ||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | ||
REMOTE_USER: ${{ secrets.REMOTE_USER }} | ||
TARGET: "/opt/open4goods/bin/latest/api-latest.jar" | ||
|
||
|
||
############################################ | ||
# Deploy UI to production server | ||
########################################### | ||
|
||
- name: Deploy UI to production server | ||
uses: easingthemes/ssh-deploy@main | ||
env: | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ARGS: "-rltgoDzvO --delete" | ||
SOURCE: "/ui/target/ui-0.0.1-SNAPSHOT.jar" | ||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | ||
REMOTE_USER: ${{ secrets.REMOTE_USER }} | ||
TARGET: "/opt/open4goods/bin/latest/ui-latest.jar" | ||
|
||
############################################ | ||
# Restart applications | ||
########################################### | ||
|
||
- name: Publish applications | ||
uses: appleboy/ssh-action@v1.0.2 | ||
with: | ||
host: ${{ secrets.REMOTE_HOST }} | ||
username: ${{ secrets.REMOTE_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY}} | ||
script: sh /opt/open4goods/bin/publish-jars.sh | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This workflow will build, test and push the latest version on the beta environment. | ||
|
||
on: push | ||
|
||
name: Build, Test and publish on beta.nudger.fr | ||
|
||
jobs: | ||
deploy: | ||
name: test-build-publish-beta | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
############################################ | ||
# Install Java | ||
########################################### | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'adopt' | ||
cache: maven | ||
|
||
############################################ | ||
# Maven build and testing | ||
########################################### | ||
|
||
- name: Build and test with Maven | ||
run: mvn --batch-mode --update-snapshots install | ||
|
||
############################################ | ||
# Deploy api JAR to qualification environment | ||
########################################### | ||
|
||
- name: Deploy API to qualification server | ||
uses: easingthemes/ssh-deploy@main | ||
env: | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ARGS: "-rltgoDzvO --delete" | ||
SOURCE: "/api/target/api-0.0.1-SNAPSHOT.jar" | ||
REMOTE_HOST: ${{ secrets.REMOTE_BETA_HOST }} | ||
REMOTE_USER: ${{ secrets.REMOTE_BETA_USER }} | ||
TARGET: "/opt/open4goods/bin/latest/api-latest.jar" | ||
|
||
############################################ | ||
# Deploy ui JAR to qualification environment | ||
########################################### | ||
|
||
- name: Deploy UI to qualification server | ||
uses: easingthemes/ssh-deploy@main | ||
env: | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ARGS: "-rltgoDzvO --delete" | ||
SOURCE: "/ui/target/ui-0.0.1-SNAPSHOT.jar" | ||
REMOTE_HOST: ${{ secrets.REMOTE_BETA_HOST }} | ||
REMOTE_USER: ${{ secrets.REMOTE_BETA_USER }} | ||
TARGET: "/opt/open4goods/bin/latest/ui-latest.jar" | ||
|
||
############################################ | ||
# Restarting application | ||
########################################### | ||
|
||
- name: Publish applications | ||
uses: appleboy/ssh-action@v1.0.2 | ||
with: | ||
host: ${{ secrets.REMOTE_BETA_HOST }} | ||
username: ${{ secrets.REMOTE_BETA_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY}} | ||
script: sh /opt/open4goods/bin/publish-jars.sh | ||
|
||
|
||
|
||
|
||
|