Skip to content

Commit

Permalink
init all and pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
JAubAot committed Apr 30, 2024
0 parents commit 93b9e33
Show file tree
Hide file tree
Showing 703 changed files with 74,230 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build-front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Generic Front build
on:
workflow_call:
inputs:
project:
required: true
type: string
tag:
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ inputs.project }}
push: true
tags: |
jaubertaot/${{ inputs.project }}:${{ inputs.tag }}
jaubertaot/${{ inputs.project }}:${{ github.ref_name }}
27 changes: 27 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Core
on:
workflow_call:
push:
paths:
- francetransfert-core/*
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
- uses: s4u/[email protected]
with:
override: false
githubServer: true
- name: Publish package
run: mvn --batch-mode clean package deploy
working-directory: francetransfert-core
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Download
on:
push:
paths:
- francetransfert-download-api/*
jobs:
getsha:
runs-on: ubuntu-latest
outputs:
shortsha: ${{ steps.short-sha.outputs.sha }}
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- run: echo $SHA
env:
SHA: ${{ steps.short-sha.outputs.sha }}
build-projects:
needs: getsha
uses: ./.github/workflows/generic-build.yml
secrets: inherit
with:
project: francetransfert-download-api
tag: ${{needs.getsha.outputs.shortsha}}
25 changes: 25 additions & 0 deletions .github/workflows/front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Download
on:
push:
paths:
- francetransfert-upload-download-gui/*
jobs:
getsha:
runs-on: ubuntu-latest
outputs:
shortsha: ${{ steps.short-sha.outputs.sha }}
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- run: echo $SHA
env:
SHA: ${{ steps.short-sha.outputs.sha }}
build-projects:
needs: getsha
uses: ./.github/workflows/build-front.yml
secrets: inherit
with:
project: francetransfert-download-api
tag: ${{needs.getsha.outputs.shortsha}}
49 changes: 49 additions & 0 deletions .github/workflows/generic-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Generic build
on:
workflow_call:
inputs:
project:
required: true
type: string
tag:
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: 'maven'
- uses: s4u/[email protected]
with:
override: false
githubServer: true
- name: Publish package
run: mvn --batch-mode clean package
working-directory: ${{ inputs.project }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ inputs.project }}
push: true
tags: |
jaubertaot/${{ inputs.project }}:${{ inputs.tag }}
jaubertaot/${{ inputs.project }}:${{ github.ref_name }}
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Manual trigger
on: workflow_dispatch
jobs:
getsha:
runs-on: ubuntu-latest
outputs:
shortsha: ${{ steps.short-sha.outputs.sha }}
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- run: echo $SHA
env:
SHA: ${{ steps.short-sha.outputs.sha }}
build-core:
uses: ./.github/workflows/core.yml
secrets: inherit
build-projects:
needs: [build-core, getsha]
strategy:
matrix:
project:
[
francetransfert-download-api,
francetransfert-upload-api,
francetransfert-worker,
]
uses: ./.github/workflows/generic-build.yml
secrets: inherit
with:
project: ${{ matrix.project }}
tag: ${{needs.getsha.outputs.shortsha}}
build-front:
needs: getsha
uses: ./.github/workflows/build-front.yml
secrets: inherit
with:
project: francetransfert-upload-download-gui
tag: ${{needs.getsha.outputs.shortsha}}
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
workflow_dispatch:
inputs:
TAG:
description: Release Tag
required: true
type: string
jobs:
release:
name: Create new release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checks-out repository
uses: actions/checkout@v4
##DO RELEASE
build-core:
needs: release
uses: ./.github/workflows/core.yml
secrets: inherit
build-projects:
needs: [build-core, release]
strategy:
matrix:
project:
[
francetransfert-download-api,
francetransfert-upload-api,
francetransfert-worker,
]
uses: ./.github/workflows/generic-build.yml
secrets: inherit
with:
project: ${{ matrix.project }}
tag: ${{ inputs.TAG }}
build-front:
needs: release
uses: ./.github/workflows/build-front.yml
secrets: inherit
with:
project: francetransfert-upload-download-gui
tag: ${{ inputs.TAG }}
25 changes: 25 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Upload
on:
push:
paths:
- francetransfert-upload-api/*
jobs:
getsha:
runs-on: ubuntu-latest
outputs:
shortsha: ${{ steps.short-sha.outputs.sha }}
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- run: echo $SHA
env:
SHA: ${{ steps.short-sha.outputs.sha }}
build-projects:
needs: getsha
uses: ./.github/workflows/generic-build.yml
secrets: inherit
with:
project: francetransfert-upload-api
tag: ${{needs.getsha.outputs.shortsha}}
25 changes: 25 additions & 0 deletions .github/workflows/worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Worker
on:
push:
paths:
- francetransfert-worker/*
jobs:
getsha:
runs-on: ubuntu-latest
outputs:
shortsha: ${{ steps.short-sha.outputs.sha }}
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- run: echo $SHA
env:
SHA: ${{ steps.short-sha.outputs.sha }}
build-projects:
needs: getsha
uses: ./.github/workflows/generic-build.yml
secrets: inherit
with:
project: francetransfert-worker
tag: ${{needs.getsha.outputs.shortsha}}
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# IntelliJ
.idea/
**/*.iml
*.iml

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Vscode
.vscode/
.settings/
.project
.factorypath
.classpath

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Maven
target/
**/target/*
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.vscode
Loading

0 comments on commit 93b9e33

Please sign in to comment.