2023-01-12 12:54:53 -05:00
|
|
|
name: 'Sync images and artifacts to ghcr'
|
2022-06-16 07:43:01 -05:00
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '30 1 * * *'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2022-07-16 18:22:38 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2022-07-27 01:13:43 -05:00
|
|
|
packages: write
|
2022-07-16 18:22:38 -05:00
|
|
|
|
2022-06-16 07:43:01 -05:00
|
|
|
jobs:
|
|
|
|
sync-golang:
|
2023-01-12 12:54:53 -05:00
|
|
|
name: 'golang'
|
2022-09-27 13:31:54 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
golang_version:
|
|
|
|
- 1.18
|
|
|
|
- 1.19
|
2022-06-16 07:43:01 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Log in to GitHub Docker Registry
|
2022-07-25 13:11:19 -05:00
|
|
|
uses: docker/login-action@v2
|
2022-06-16 07:43:01 -05:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Tag and push golang to ghcr
|
|
|
|
run: |
|
2022-09-27 13:31:54 -05:00
|
|
|
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 }}
|
2023-01-12 12:54:53 -05:00
|
|
|
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: |
|
2023-01-12 13:01:43 -05:00
|
|
|
oras copy ghcr.io/aquasecurity/trivy-db:2 ghcr.io/${{ github.repository_owner }}/trivy-db:2
|