Skip to content

Commit

Permalink
Added docker publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Feb 11, 2024
1 parent a01a629 commit 916531d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_maven_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- uses: actions/setup-node@v4
- uses: actions/setup-node@main
with:
node-version: 20
- name: Maven version
Expand Down
30 changes: 10 additions & 20 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,45 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@main
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Echo ref name trigger
run: echo ${{ github.ref_name }}
- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@main
with:
java-version: '17'
distribution: 'corretto'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@v4
uses: actions/cache@main
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache SonarCloud packages
uses: actions/cache@v1
- uses: actions/setup-node@main
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Maven version
run: mvn -v
env:
# Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
node-version: 20
- name: Build main project
run: mvn -B clean install -P full,coverage,metadata,buildreact
- name: Build quarkus project
run: cd fj-doc-playground-quarkus;mvn -B clean install -P full,coverage,metadata,buildreact
# using action https://github.com/marketplace/actions/build-and-push-docker-images
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@master
- name: Login to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: fj-doc-playground-quarkus
platforms: linux/amd64,linux/arm64
push: true
tags: fugeritorg/fj-daogen-quickstart:${{ github.ref_name }},fugeritorg/fj-daogen-quickstart:latest
tags: fugeritorg/fj-doc-playground-quarkus:${{ github.ref_name }},fugeritorg/fj-doc-playground-quarkus:latest

0 comments on commit 916531d

Please sign in to comment.