Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/cd: Upload artifacts to Aqua registry #305

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
username: ${{ vars.GHCR_USER || env.GH_USER }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup ORAS
uses: oras-project/setup-oras@v1
with:
version: '1.0.0'

- name: Deploy policy bundle to ghcr.io (for backwards compatibility)
run: |
tags=(latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
Expand Down Expand Up @@ -64,3 +69,21 @@ jobs:
--artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
done

- name: login to Aqua Container Registry
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}
username: ${{ secrets.AQUASEC_ACR_USERNAME }}
password: ${{ secrets.AQUASEC_ACR_PASSWORD }}

- name: Deploy checks bundle to Aqua Container Registry
run: |
tags=(1 latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
repo="${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}/${{ github.event.repository.name }}"
for tag in ${tags[@]}; do
echo "Pushing artifact with tag: ${tag}"
oras push ${repo}:${tag} \
--artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
done
Loading