Bugs/nrmn 1384 add test before change #6849
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: Docker Build Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build Docker Image | |
uses: docker/build-push-action@v4 | |
env: | |
BUILDER_UID: ${{ runner.uid }} | |
with: | |
context: . | |
file: Dockerfile.build | |
load: true | |
build-args: BUILDER_UID=${{ env.BUILDER_UID }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
tags: nrmn-build:latest | |
- name: Run Pipeline Steps | |
run: | | |
docker run --rm \ | |
-v ${{ github.workspace }}:/workspace \ | |
-v ${{ runner.home }}/.m2:/home/builder/.m2 \ | |
-v ${{ runner.home }}/.cache:/home/builder/.cachejournal/ \ | |
-v ${{ runner.home }}/bin:${HOME}/bin \ | |
-w /workspace \ | |
--entrypoint /bin/bash \ | |
nrmn-build:latest -c ' | |
git reset --hard | |
git clean --force --force -xd --exclude=web/node_modules | |
yarn --cwd web --immutable | |
mvn -e --batch-mode --threads 2 --define maven.test.skip=true clean package | |
' | |
- name: Archive Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: war-file | |
path: app/target/*.war |