Skip to content

Commit

Permalink
Adding github actions build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
renemadsen committed Apr 1, 2024
1 parent b828011 commit e5834da
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Main

on:
push:
paths-ignore:
- '*.md'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
id: build
run: docker build . -t dvfdocker/owlcms4:latest
shell: bash
- run: docker save dvfdocker/owlcms4:latest -o owlcms4.tar
- uses: actions/upload-artifact@v3
with:
name: owlcms4
path: owlcms4.tar
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Go offline using the pom.xml
run: mvn dependency:go-offline package -P production -am -pl owlcms -Dmaven.test.skip=true
- name: Run tests
run: mvn clean test -pl owlcms
deploy:
runs-on: ubuntu-latest
needs: [test, build]
steps:
- uses: actions/download-artifact@v3
with:
name: owlcms4
- run: docker load -i owlcms4.tar
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push the tagged Docker image
run: docker push dvfdocker/owlcms4:latest

0 comments on commit e5834da

Please sign in to comment.