Release #5
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: release | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: tp2intervals | |
jobs: | |
docker: | |
name: Docker Image Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 21 | |
distribution: 'corretto' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.10.0 | |
- name: Build backend | |
working-directory: ./boot | |
run: ./gradlew build | |
- name: Build frontend | |
working-directory: ./ui | |
run: npm ci && npm run build | |
- name: Build image | |
run: docker build . --file Dockerfile --tag $IMAGE_NAME | |
- name: Log into registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin | |
- name: Push image | |
run: | | |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
# Use Docker `latest` tag convention | |
VERSION=latest | |
echo IMAGE_ID=$IMAGE_ID | |
echo VERSION=$VERSION | |
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION | |
jar: | |
name: Jar Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 21 | |
distribution: 'corretto' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.10.0 | |
- name: Build frontend | |
working-directory: ./ui | |
run: npm ci && npm run build | |
- name: Copy UI | |
run: cp -r ui/dist/ui/browser/ boot/src/main/resources/static | |
- name: Build backend | |
working-directory: ./boot | |
run: ./gradlew build | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: boot/build/libs/tp2intervals.jar | |
if-no-files-found: error |