Improve JPA configuration #40
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 and push docker image | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
jobs: | |
dockerhub: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: set env | |
run: | | |
curl -o setenv.sh -- 'https://raw.githubusercontent.com/t2-project/devops/main/setenv.sh' | |
vi setenv.sh -c ':%s/^export //' -c ':%s/\(.*\)#.*/\1/' -c ':%s/\s*$//g' -c ':wq' # Strip out 'export ' at the beginning, comments, and trailing whitespace | |
cat setenv.sh >> $GITHUB_ENV | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: check out order | |
uses: actions/checkout@v2 | |
with: | |
path: './order' | |
- name: check out common | |
uses: actions/checkout@master | |
with: | |
repository: t2-project/common | |
path: './common' | |
- name: set up jdk | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: build common | |
run: cd common && ./mvnw clean install | |
- name: verify order | |
run: cd order && ./mvnw clean install | |
- run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Build and push (manual) | |
run: | | |
echo ${{ env.RELEASE_VERSION }} | |
echo $RELEASE_VERSION | |
cd order | |
docker build -t t2project/order:${{ env.RELEASE_VERSION }} . | |
docker push t2project/order:${{ env.RELEASE_VERSION }} |