-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: publish
rpc-proxy
Dockerfile on tag (#1454)
* feat: first commit * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor * feat: file refactor
- Loading branch information
1 parent
92100a2
commit c02b2ff
Showing
6 changed files
with
97 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Jobs on tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
npm-publish: | ||
uses: ./.github/workflows/publish-sdk.yml | ||
secrets: inherit | ||
|
||
rpc-proxy-docker-publish: | ||
uses: ./.github/workflows/rpc-proxy.yml | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
name: Publish NPM package | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: RPC Proxy - Docker build, scan and push | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
checks: write | ||
actions: read | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: vechain/sdk-rpc-proxy | ||
|
||
- name: Build and export to Docker | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: docker/rpc-proxy/Dockerfile | ||
load: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Split tags and get the first value for scanning | ||
id: split-tags | ||
run: echo "first-tag=$(echo '${{ steps.meta.outputs.tags }}' | cut -d',' -f1)" >> $GITHUB_OUTPUT | ||
|
||
- name: Run Trivy Scan | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: ${{ steps.split-tags.outputs.first-tag }} | ||
format: 'table' | ||
ignore-unfixed: true | ||
exit-code: '1' | ||
vuln-type: os,library | ||
severity: CRITICAL,HIGH,MEDIUM | ||
scanners: misconfig,vuln,secret | ||
env: | ||
# See https://github.com/aquasecurity/trivy/discussions/7538 | ||
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 | ||
|
||
- name: Build and push | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: docker/rpc-proxy/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
This file was deleted.
Oops, something went wrong.
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
c02b2ff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test Coverage
Summary