Skip to content

Commit

Permalink
DEVOPS-685: Upload to aqua
Browse files Browse the repository at this point in the history
  • Loading branch information
Lihi Zitzer committed Dec 24, 2024
1 parent 14deeea commit 31b38e0
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ jobs:
name: Build DB
runs-on: ubuntu-24.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
# - name: Check out code into the Go module directory
# uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
id: go

- name: Build the binary
run: make build

- name: Crawl indexes
run: make db-crawl

- name: Build database
run: make db-build
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version-file: go.mod
# id: go

- name: Compress database
run: make db-compress
# - name: Build the binary
# run: make build

- name: Move DB
run: mv cache/db/javadb.tar.gz .
# - name: Crawl indexes
# run: make db-crawl
#
# - name: Build database
# run: make db-build
#
# - name: Compress database
# run: make db-compress
#
# - name: Move DB
# run: mv cache/db/javadb.tar.gz .

# - 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: Login to GitHub Packages Container registry
# uses: docker/login-action@v3
Expand Down Expand Up @@ -96,9 +96,7 @@ jobs:
full_registry_url="${registry}/${repo_name}"
echo "Processing registry: ${full_registry_url}"
if ./oras push --artifact-type application/vnd.aquasec.trivy.config.v1+json \
"${full_registry_url}:${DB_VERSION}" \
javadb.tar.gz:application/vnd.aquasec.trivy.javadb.layer.v1.tar+gzip; then
if ./oras copy docker.io/aquasec/trivy-java-db:1 "${full_registry_url}:${DB_VERSION}"; then
echo "Successfully pushed to ${full_registry_url}:${DB_VERSION}"
else
echo "Failed to push to ${full_registry_url}:${DB_VERSION}"
Expand Down

0 comments on commit 31b38e0

Please sign in to comment.