diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 000000000..b6a241fb7 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,50 @@ +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: Build + run: mvn dependency:go-offline package -P production -am -pl owlcms -Dmaven.test.skip=true + - name: Run tests + run: mvn dependency:go-offline 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 \ No newline at end of file