Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Lihi Zitzer committed Dec 23, 2024
1 parent 018aee6 commit cb85e1f
Showing 1 changed file with 41 additions and 47 deletions.
88 changes: 41 additions & 47 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
tags:
- "lihiz.tag.*"
- "v*"
env:
GH_USER: aqua-bot
AQUA_DOCKERHUB_REPO: aquasec
Expand All @@ -19,62 +19,56 @@ jobs:
- name: Create bundle
run: make bundle

# - name: Login to GitHub Packages Container registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ vars.GHCR_USER || env.GH_USER }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ vars.GHCR_USER || env.GH_USER }}
password: ${{ secrets.GITHUB_TOKEN }}

# Set up ORAS
- name: Setup ORAS
uses: oras-project/setup-oras@v1
with:
version: '1.0.0' # Specify the ORAS version, or omit for the latest

# Verify ORAS installation
- name: Verify ORAS installation
- name: Deploy policy bundle to ghcr.io (for backwards compatibility)
run: |
oras version
# - name: Deploy policy bundle to ghcr.io (for backwards compatibility)
# run: |
# tags=(latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
# for tag in ${tags[@]}; do
# echo "Pushing artifact with tag: ${tag}"
# oras push ghcr.io/${{ github.event.repository.owner.name }}/trivy-policies:${tag} \
# --artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
# --annotation "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
# --annotation "org.opencontainers.image.revision=$GITHUB_SHA" \
# bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
# done
tags=(latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
for tag in ${tags[@]}; do
echo "Pushing artifact with tag: ${tag}"
oras push ghcr.io/${{ github.event.repository.owner.name }}/trivy-policies:${tag} \
--artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
--annotation "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
--annotation "org.opencontainers.image.revision=$GITHUB_SHA" \
bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
done
# - name: Deploy checks bundle to ghcr.io
# run: |
# tags=(latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
# for tag in ${tags[@]}; do
# echo "Pushing artifact with tag: ${tag}"
# oras push ghcr.io/${{ github.repository }}:${tag} \
# --artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
# bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
# done
- name: Deploy checks bundle to ghcr.io
run: |
tags=(latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
for tag in ${tags[@]}; do
echo "Pushing artifact with tag: ${tag}"
oras push ghcr.io/${{ github.repository }}:${tag} \
--artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
done
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USER }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Deploy checks bundle to Docker Hub
# run: |
# tags=(latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
# repo="${{ vars.DOCKERHUB_REPOSITORY || env.AQUA_DOCKERHUB_REPO }}/${{ github.event.repository.name }}"
# for tag in ${tags[@]}; do
# echo "Pushing artifact with tag: ${tag}"
# oras push docker.io/${repo}:${tag} \
# --artifact-type application/vnd.cncf.openpolicyagent.config.v1+json \
# bundle.tar.gz:application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip
# done
- name: Deploy checks bundle to Docker Hub
run: |
tags=(latest ${{ env.RELEASE_VERSION}} ${{env.MINOR_VERSION }} ${{ env.MAJOR_VERSION }})
repo="${{ vars.DOCKERHUB_REPOSITORY || env.AQUA_DOCKERHUB_REPO }}/${{ github.event.repository.name }}"
for tag in ${tags[@]}; do
echo "Pushing artifact with tag: ${tag}"
oras push docker.io/${repo}:${tag} \
--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
Expand Down

0 comments on commit cb85e1f

Please sign in to comment.