-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4aef35a
commit acae954
Showing
1 changed file
with
30 additions
and
13 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 |
---|---|---|
|
@@ -87,6 +87,9 @@ jobs: | |
|
||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
commit-message: ${{ steps.get-commit-message.outputs.message }} | ||
|
||
env: | ||
SBT_OPTS: > | ||
-Xms2048m | ||
|
@@ -120,6 +123,12 @@ jobs: | |
version: "25.2" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get commit message | ||
id: get-commit-message | ||
run: | | ||
message="$(git log -1 --pretty=format:'%s')" | ||
echo "message=$message" >> "$GITHUB_OUTPUT" | ||
- name: Get the Ref | ||
id: get-ref | ||
uses: ankitvgupta/[email protected] | ||
|
@@ -138,42 +147,45 @@ jobs: | |
context: ./backend/mockingbird-api/target/docker/stage | ||
push: false | ||
tags: ${{ env.MOCKINGBIRD_TEST_IMAGE_JVM }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') ) }} | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }} | ||
if: ${{ github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') }} | ||
|
||
- name: Build and push docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./backend/mockingbird-api/target/docker/stage | ||
push: true | ||
tags: ghcr.io/leviysoft/mockingbird:${{ steps.get-ref.outputs.tag }} | ||
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }} | ||
if: ${{ github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') }} | ||
|
||
- name: Save docker image to file | ||
run: | | ||
docker save -o /tmp/image-jvm.tar ${{ env.MOCKINGBIRD_TEST_IMAGE_JVM }} | ||
gzip /tmp/image-jvm.tar | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') ) }} | ||
|
||
- name: Upload image with JVM mockingbird | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: image-jvm | ||
path: /tmp/image-jvm.tar.gz | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') ) }} | ||
|
||
back-build-native: | ||
needs: [front-build] | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
outputs: | ||
commit-message: ${{ steps.get-commit-message.outputs.message }} | ||
|
||
env: | ||
CI: true | ||
SBT_OPTS: > | ||
|
@@ -209,6 +221,12 @@ jobs: | |
version: "25.2" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get commit message | ||
id: get-commit-message | ||
run: | | ||
message="$(git log -1 --pretty=format:'%s')" | ||
echo "message=$message" >> "$GITHUB_OUTPUT" | ||
- name: Get the Ref | ||
id: get-ref | ||
uses: ankitvgupta/[email protected] | ||
|
@@ -232,40 +250,40 @@ jobs: | |
context: ./backend/mockingbird-native/target/docker/stage | ||
push: false | ||
tags: ${{ env.MOCKINGBIRD_TEST_IMAGE_NATIVE }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') ) }} | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }} | ||
if: ${{ github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') }} | ||
|
||
- name: Build and push docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./backend/mockingbird-native/target/docker/stage | ||
push: true | ||
tags: ghcr.io/leviysoft/mockingbird:${{ steps.get-ref.outputs.tag }}-native | ||
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }} | ||
if: ${{ github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') }} | ||
|
||
- name: Save docker image to file | ||
run: | | ||
docker save -o /tmp/image-native.tar ${{ env.MOCKINGBIRD_TEST_IMAGE_NATIVE }} | ||
gzip /tmp/image-native.tar | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') ) }} | ||
|
||
- name: Upload image with native mockingbird | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: image-native | ||
path: /tmp/image-native.tar.gz | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(steps.get-commit-message.outputs.message, '[docker]') ) }} | ||
|
||
test-jvm-image: | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
needs: [back-build] | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(needs.back-build.outputs.commit-message, '[docker]') ) }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -298,8 +316,8 @@ jobs: | |
sbt "project examples; clean; fixCheck; test" | ||
test-native-image: | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
needs: [back-build-native] | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(needs.back-build-native.outputs.commit-message, '[docker]') ) }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -332,7 +350,6 @@ jobs: | |
sbt "project examples; clean; fixCheck; test" | ||
test-example-dsl: | ||
if: ${{ ! ( github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') ) }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|