Harbor #93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Harbor | |
on: | |
# push: | |
# branches: | |
# - main | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
Harbor: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: get harbor | |
run: | | |
wget https://github.com/goharbor/harbor/releases/download/v2.12.2//harbor-offline-installer-v2.12.2.tgz | |
- name: Upload Image Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: harbor-offline-installer-2.12.2 | |
path: harbor-offline-installer-v2.12.2.tgz | |
trivy-db: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build project | |
run: | | |
# 安装 oras | |
export VERSION="1.0.0" | |
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz" | |
mkdir -p oras-install/ | |
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/ | |
sudo mv oras-install/oras /usr/local/bin/ | |
rm -rf oras_${VERSION}_*.tar.gz oras-install/ | |
# 查看 oras 版本 | |
oras version | |
# 使用oras拉取trivy-db:2 | |
oras pull ghcr.io/aquasecurity/trivy-db:2 | |
- name: Upload Image Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: trivy-db | |
path: db.tar.gz | |
trivy-java-db: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build project | |
run: | | |
# 安装 oras | |
export VERSION="1.0.0" | |
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz" | |
mkdir -p oras-install/ | |
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/ | |
sudo mv oras-install/oras /usr/local/bin/ | |
rm -rf oras_${VERSION}_*.tar.gz oras-install/ | |
# 查看 oras 版本 | |
oras version | |
# 使用oras拉取trivy-java-db:1 | |
oras pull ghcr.io/aquasecurity/trivy-java-db:1 | |
- name: Upload Image Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: trivy-java-db | |
path: javadb.tar.gz |