0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2025-01-06 22:40:28 -05:00
zot/.github/workflows/sync-3rdparty-images.yaml
Andrei Aaron 6f5b7afd39
ci(trivy): copy trivydb oci artefact to project-zot repo (#1106)
This will replace calls made directly to ghcr.io/aquasecurity/trivy-db
Which are hitting the rate limiter

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2023-01-12 09:54:53 -08:00

47 lines
1.4 KiB
YAML

name: 'Sync images and artifacts to ghcr'
on:
schedule:
- cron: '30 1 * * *'
push:
branches:
- main
permissions:
contents: read
packages: write
jobs:
sync-golang:
name: 'golang'
strategy:
matrix:
golang_version:
- 1.18
- 1.19
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and push golang to ghcr
run: |
docker trust inspect golang:${{ matrix.golang_version }}
docker pull golang:${{ matrix.golang_version }}
docker tag golang:${{ matrix.golang_version }} ghcr.io/${{ github.repository_owner }}/golang:${{ matrix.golang_version }}
docker push ghcr.io/${{ github.repository_owner }}/golang:${{ matrix.golang_version }}
sync-trivy:
name: 'trivy-db'
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Copy trivy-db using oras cli
run: |
oras copy ghcr.io/aquasecurity/trivy-db:2 ghcr.io/ghcr.io/${{ github.repository_owner }}/trivy-db:2