Update ci.yml #297
Workflow file for this run
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: ci | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: link Node.js to frontend module | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
which npm | |
which node | |
node --version | |
pwd | |
ls -lr | |
ln -s /opt/hostedtoolcache/node/20.12.2/x64/node/bin ./frontend/node | |
- name: Build with Maven | |
run: ./mvnw clean verify | |
- name: Publish Test Report | |
if: success() || failure() | |
uses: scacap/action-surefire-report@v1 | |
release: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Publish package [on main] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./mvnw versions:set -DnewVersion=1.0.${{ github.run_number }} | |
./mvnw deploy -DskipTests -Denv=mysql | |
- uses: actions/delete-package-versions@v5 | |
with: | |
package-name: 'com.github.binpastes.backend' | |
package-type: 'maven' | |
min-versions-to-keep: 3 |