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 (#126)
Browse files Browse the repository at this point in the history
* Add Cosign and new MTR

* Remove Spaces
  • Loading branch information
f11h authored Jul 29, 2022
1 parent fe1e925 commit c2fe36d
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 Down Expand Up @@ -57,10 +58,12 @@ jobs:
docker build \
--tag docker.pkg.github.com/${GITHUB_REPOSITORY}/${ARTIFACT_ID}:${VERSION} \
--tag ${TRUSTED_URL}/${TRUSTED_REPOSITORY}/${ARTIFACT_ID}:${VERSION} \
--tag ${MTR_REPOSITORY}/cwa-verification-portal:${VERSION} \
.
env:
TRUSTED_URL: ${{ secrets.TRUSTED_URL }}
TRUSTED_REPOSITORY: ${{ secrets.TRUSTED_REPOSITORY }}
MTR_REPOSITORY: ${{ secrets.MTR_REPOSITORY }}
- name: docker push github
run: |
echo ${GITHUB_TOKEN} | docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY_OWNER} --password-stdin
Expand All @@ -87,3 +90,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-verification-portal:${VERSION}
cosign sign --key env://MTR_PRIVATE_KEY ${MTR_REPOSITORY}/cwa-verification-portal:${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 c2fe36d

Please sign in to comment.