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

Feat: CI Cosign #126

Merged
merged 2 commits into from
Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}