Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Feat: CI COSIGN (#250)
Browse files Browse the repository at this point in the history
* Add COSIGN to CI

* Add Image Tag for new MTR
  • Loading branch information
f11h authored Jul 25, 2022
1 parent 4f0a2c0 commit d8d041f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: sigstore/cosign-installer@main
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand All @@ -26,6 +27,7 @@ jobs:
--tag ghcr.io/${GITHUB_REPOSITORY}/cwa-quick-test-backend:latest
--tag ghcr.io/${GITHUB_REPOSITORY}/cwa-quick-test-backend:${VERSION}
--tag ${TRUSTED_URL}/${TRUSTED_REPOSITORY}/cwa-quick-test-backend:${VERSION}
--tag ${MTR_REPOSITORY}/cwa-quick-test-backend:${VERSION}
--build-arg MAVEN_PASSWORD=${APP_PACKAGES_PASSWORD}
--build-arg MAVEN_USERNAME=${APP_PACKAGES_USERNAME}
.
Expand All @@ -34,6 +36,7 @@ jobs:
TRUSTED_REPOSITORY: ${{ secrets.TRUSTED_REPOSITORY }}
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
MTR_REPOSITORY: ${{ secrets.MTR_REPOSITORY }}
- name: docker push github
run: |
echo ${GITHUB_TOKEN} | docker login ghcr.io -u ${GITHUB_REPOSITORY_OWNER} --password-stdin
Expand Down Expand Up @@ -61,3 +64,14 @@ jobs:
TRUSTED_REPOSITORY: ${{ secrets.TRUSTED_REPOSITORY }}
TRUSTED_USER: ${{ secrets.TRUSTED_USER }}
TRUSTED_TOKEN: ${{ secrets.TRUSTED_TOKEN }}
- name: docker push new mtr
run: |
echo ${MTR_TOKEN} | docker login ${MTR_REPOSITORY} -u ${MTR_USER} --password-stdin
docker push ${MTR_REPOSITORY}/cwa-quick-test-backend:${VERSION}
cosign sign --key env://MTR_PRIVATE_KEY ${MTR_REPOSITORY}/cwa-quick-test-backend:${VERSION}
env:
MTR_REPOSITORY: ${{ secrets.MTR_REPOSITORY }}
MTR_USER: ${{ secrets.MTR_USER }}
MTR_TOKEN: ${{ secrets.MTR_TOKEN }}
MTR_PRIVATE_KEY: ${{ secrets.MTR_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.MTR_PRIVATE_KEY_PASSWORD }}

0 comments on commit d8d041f

Please sign in to comment.