Skip to content

Commit

Permalink
feat(ci): add auto sync to registry (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
DVKunion authored Jul 3, 2023
1 parent 11fad24 commit 4400379
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/veinmind-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
required: true
DOCKERHUB_TOKEN:
required: true
HARBOR_USERNAME:
required: true
HARBOR_PASSWORD:
required: true

jobs:
# push python plugins
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/veinmind-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: veinmind-tools-sync
on:
workflow_call:
secrets:
HARBOR_USERNAME:
required: true
HARBOR_PASSWORD:
required: true
jobs:
sync_harbor:
strategy:
fail-fast: false
matrix:
plugin: [
veinmind-backdoor,
veinmind-history,
veinmind-basic,
veinmind-escape,
veinmind-privilege-escalation,
veinmind-iac,
veinmind-log4j2,
veinmind-malicious,
veinmind-sensitive,
veinmind-unsafe-mount,
veinmind-vuln,
veinmind-weakpass,
veinmind-webshell,
veinmind-minio,
veinmind-runner
]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: skopeo-copy
run: |
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.HARBOR_USERNAME }}:${{ secrets.HARBOR_PASSWORD }} veinmind/${{ matrix.plugin }}:${{github.ref_name}} registry.veinmind.tech/veinmind/
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.HARBOR_USERNAME }}:${{ secrets.HARBOR_PASSWORD }} veinmind/${{ matrix.plugin }}:latest registry.veinmind.tech/veinmind/
5 changes: 5 additions & 0 deletions .github/workflows/veinmind-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@ jobs:
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
sync:
if: startsWith(github.ref, 'refs/tags/')
needs: [ push ]
uses: ./.github/workflows/veinmind-sync.yml
secrets:
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}

0 comments on commit 4400379

Please sign in to comment.