-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from clementguillot/18-add-oci-image-build-to-…
…pipeline 18 add oci image build to pipeline
- Loading branch information
Showing
8 changed files
with
641 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
|
||
# Cancel in progress workflows on pull_requests. | ||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
# Needed for nx-set-shas when run on the main branch | ||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/nx-affected-target | ||
with: | ||
target: build | ||
|
||
build-oci-images: | ||
needs: | ||
- build | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: ./.github/actions/nx-affected-target | ||
with: | ||
target: container | ||
env: | ||
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/nx-affected-target | ||
with: | ||
target: test | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/nx-affected-target | ||
with: | ||
target: lint | ||
|
||
push-oci-images: | ||
needs: | ||
- build | ||
- test | ||
- lint | ||
if: github.event_name != 'pull_request' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: ./.github/actions/nx-affected-target | ||
with: | ||
target: container | ||
env: | ||
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
INPUT_PUSH: true |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
!build/*-runner.jar | ||
!build/lib/* | ||
!build/quarkus-app/* | ||
!build/native-sources/* |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 AS build | ||
|
||
COPY --chown=quarkus:quarkus build/native-sources /code/native-sources | ||
USER quarkus | ||
WORKDIR /code/native-sources | ||
RUN native-image $(cat native-image.args) | ||
|
||
FROM quay.io/quarkus/quarkus-micro-image:2.0 | ||
|
||
WORKDIR /work/ | ||
RUN chown 1001 /work \ | ||
&& chmod "g+rwX" /work \ | ||
&& chown 1001:root /work | ||
COPY --from=build --chown=1001:root /code/native-sources/*-runner /work/application | ||
|
||
EXPOSE 8080 | ||
USER 1001 | ||
|
||
ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] |
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
Oops, something went wrong.