Created
December 19, 2021 21:19
-
-
Save colinbut/d268449455c7720d6be54b7986deb085 to your computer and use it in GitHub Desktop.
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: Build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: install deps | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: compile | |
run: ./mvnw clean compile | |
- name: unit test | |
run: ./mvnw test | |
- name: integration test | |
run: ./mvnw verify | |
- name: package jar artifact | |
run: ./mvnw -Dmaven.test.skip=true package | |
- name: deploy jar artifact to GitHub Packages | |
run: ./mvnw -Dmaven.test.skip=true -B deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: push docker image to Docker Hub | |
uses: docker/build-push-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
repository: colinbut/github-actions-java-app | |
tag_with_ref: true | |
- name: push docker image to GitHub Container Registry | |
uses: docker/build-push-action@v1 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: docker.pkg.github.com | |
repository: colinbut/github-actions-java-app/github-actions-java-app | |
tag_with_ref: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment