prepare v1.0.1 #132
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
name: Application CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- main | |
jobs: | |
pipeline: | |
name: EADesignIt pipeline | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.pull_request.title, '[skip ci]') && !contains(github.event.pull_request.title, '[ci skip]')" | |
timeout-minutes: 40 | |
env: | |
NODE_VERSION: 18.18.1 | |
SPRING_OUTPUT_ANSI_ENABLED: DETECT | |
SPRING_JPA_SHOW_SQL: false | |
JHI_DISABLE_WEBPACK_LOGS: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.18.1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Install node.js packages | |
run: npm install | |
- name: Run backend test | |
run: | | |
chmod +x mvnw | |
npm run ci:backend:test | |
- name: Run frontend test | |
run: npm run ci:frontend:test | |
- name: Package application | |
run: npm run java:jar:prod | |
- name: Build and publish docker image | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) | |
run: | | |
GIT_TAG=:${GITHUB_REF#refs/tags/} | |
DOCKER_TAG=${GIT_TAG#:refs/heads/main} | |
./mvnw -ntp jib:build -Djib.to.image=mauvaisetroupe/ea-design-it${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKERHUB_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKERHUB_TOKEN }}" | |
# Add steps to push to Quay.io | |
- name: Build and publish Docker image to Quay.io | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) | |
run: | | |
GIT_TAG=:${GITHUB_REF#refs/tags/} | |
DOCKER_TAG=${GIT_TAG#:refs/heads/main} | |
./mvnw -ntp jib:build -Djib.to.image=quay.io/mauvaisetroupe/ea-design-it${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.QUAYIO_USERNAME }}" -Djib.to.auth.password="${{ secrets.QUAYIO_TOKEN }}" | |