Update README.md #254
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Java CI with Maven | |
on: [push, pull_request] | |
env: | |
IMAGE_NAME: wings | |
#variables related with the docker imager registry | |
DOCKER_IMAGE_REPOSITORY: ikcap | |
DOCKER_IMAGE_NAME: wings | |
DOCKER_FILE: "wings-docker/docker/default/Dockerfile" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v6 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
env: | |
GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: mkdir staging && cp */target/*.war staging | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: Package | |
path: staging | |
- name: Create environment variable with the commit id | |
run: | | |
echo "DOCKER_TAG=${GITHUB_SHA}" >> $GITHUB_ENV | |
- name: Create environment variable with the version id | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
[ "$VERSION" == "master" ] && VERSION=latest | |
echo "WINGS_VERSION=${VERSION}" >> $GITHUB_ENV | |
- name: Expose the commit id | |
id: exposeValue | |
run: | | |
echo "::set-output name=docker_tag::${{ env.DOCKER_TAG }}" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
push: true | |
context: . | |
tags: ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:latest, ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_TAG }}, ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.WINGS_VERSION }} | |
file: ${{ env.DOCKER_FILE}} | |
platforms: linux/amd64,linux/arm64 |