Skip to content

Fix #115: CHORE: Update dependencies. #68

Fix #115: CHORE: Update dependencies.

Fix #115: CHORE: Update dependencies. #68

Workflow file for this run

#####################################################################################
# GitHub action file to support automatic build and deployment of Wica-HTTP Artifacts
#####################################################################################
#
# This build recipe should be set up to trigger every time new TAGGED commits
# are pushed to the Wica-HTTP repository in the PSI Organisational Area on the
# GitHub Server.
#
# Currently, the build recipe supports the following actions:
#
# - Builds Wica-HTTP API documentation and transfers asset to GitHub Pages Area.
# - Builds Wica-HTTP Release Bundle and transfers asset to GitHub Releases Area.
# - Builds Wica-HTTP Docker Image and transfers asset to Docker Hub.
#
# This is a basic workflow to help you get started with Actions
name: Wica-HTTP CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- "!*"
tags:
- "*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Setup Java environment and build with maven
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
# Note: maven CLI options: -B means run in batch mode, -V means display version information.
run: mvn -B package -DskipTests=true --file pom.xml
- name: Deploy GitHub Javadoc to GitHub Pages Area 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
# The branch the action should deploy to.
folder: target/site/apidocs
# The folder the action should deploy.
- name: Get version from pom.xml
id: get_version
uses: mavrosxristoforos/get-xml-info@1.0
with:
xml-file: 'pom.xml'
xpath: //*[local-name()='project']/*[local-name()='version']
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.get_version.outputs.info }}
release_name: ${{ steps.get_version.outputs.info }}
body: |
See the CHANGELOG.md file for the changes in this Release
draft: false§
prerelease: false
- name: Upload Wica-Http ZIP File to Release Assets Area
id: upload-release-asset
uses: csexton/release-asset-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
pattern: "target/*.jar"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ steps.create_release.outputs.upload_url }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Docker Setup Build Environment
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker Build and push to Docker Hub
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./
file: ./docker/Dockerfile.http
push: true
tags: paulscherrerinstitute/wica-http:${{ steps.get_version.outputs.info }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}