Skip to content

Commit

Permalink
finalize docker image build and publish on commit (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Senic authored Feb 6, 2023
1 parent d5bfe28 commit e5430bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ jobs:
include:
- type: docker
profile: ''
image: jsonapi

- type: native
profile: '-Pnative'
image: jsonapi-native

steps:
- uses: actions/checkout@v3
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/docker-image-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ jobs:
name: Main
runs-on: ubuntu-latest

# matrix props:
strategy:
matrix:
type: [ docker, native ]
include:
- type: docker
profile: ''

- type: native
profile: '-Pnative'

steps:
- uses: actions/checkout@v3

Expand All @@ -50,18 +61,22 @@ jobs:

- name: Build and push (Amazon ECR)
run: |
./mvnw -B -ntp clean package -DskipTests -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true -Dquarkus.container-image.registry=${{ secrets.ECR_REPOSITORY }} -Dquarkus.container-image.tag=${{github.sha}}
./mvnw -B -ntp clean package -DskipTests -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true -Dquarkus.container-image.registry=${{ secrets.ECR_REPOSITORY }} -Dquarkus.container-image.tag=${{ github.sha }} -Dquarkus.container-image.additional-tags='' ${{ matrix.profile }}
# signs docker image with cosign
sign:
name: Sign image
needs: [main]
runs-on: ubuntu-latest

# matrix props:
strategy:
matrix:
image: [ jsonapi, jsonapi-native ]

env:
# not a newest version, this reflects riptano action target version
COSIGN_VERSION: v1.9.0
IMAGE_NAME: jsonapi

steps:
- name: Install Cosign
Expand All @@ -83,9 +98,9 @@ jobs:
- name: Sign a docker image
shell: bash
env:
COSIGN_IMAGE: ${{ secrets.ECR_REPOSITORY }}/stargateio/${IMAGE_NAME}:${{github.sha}}
COSIGN_PRIVATE_BASE64: ${{ secrets.COSIGN_PRIVATE_BASE64}}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD}}
COSIGN_IMAGE: ${{ secrets.ECR_REPOSITORY }}/stargateio/${{ matrix.image }}:${{ github.sha }}
COSIGN_PRIVATE_BASE64: ${{ secrets.COSIGN_PRIVATE_BASE64 }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_KEY_FILE: _cosign_key_
AUX_KEY: signedby
AUX_VALUE: stargate
Expand Down

0 comments on commit e5430bc

Please sign in to comment.