Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Integrate Docker Image Build on Release Publication 🐳 #87

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
13440af
[Feature] integrate Docker image build on release publication 🐳
KlementXV Jul 17, 2024
8655c66
fix: image repo
KlementXV Jul 17, 2024
d85060b
Merge branch 'regolith-labs:master' into master
KlementXV Jul 19, 2024
daffcd7
Fix: incorrect entrypoint permissions
KlementXV Jul 19, 2024
64daefb
Remove testnet from the RPC_URL list
KlementXV Jul 20, 2024
ea3699d
Merge branch 'regolith-labs:master' into master
KlementXV Jul 27, 2024
0d9f555
chore: Update ORE mining launcher script
KlementXV Jul 29, 2024
9942168
Merge branch 'regolith-labs:master' into master
KlementXV Jul 29, 2024
d840411
chore: Update ORE mining launcher script
KlementXV Jul 29, 2024
260c22b
Merge branch 'regolith-labs:master' into update_entrypoint
KlementXV Jul 30, 2024
186b647
chore: update Dockerfile to include cargo update before building
KlementXV Jul 30, 2024
f08500c
chore: Update Dockerfile to include cargo update before building
KlementXV Jul 30, 2024
a08515d
chore: update entrypoint script
KlementXV Jul 30, 2024
f00a83c
Merge pull request #1 from KlementXV/update_entrypoint
KlementXV Jul 30, 2024
267b8f5
chore: Update README
KlementXV Jul 30, 2024
41bbdb2
Merge branch 'regolith-labs:master' into master
KlementXV Jul 31, 2024
7bff11d
Merge branch 'regolith-labs:master' into master
KlementXV Aug 2, 2024
183718a
chore: Update Dockerfile to use specific Alpine versions for builder …
KlementXV Aug 5, 2024
d061197
Merge branch 'regolith-labs:master' into master
KlementXV Aug 6, 2024
276dc7c
chore: Add support for setting priority fee in entrypoint script
KlementXV Aug 6, 2024
26e7536
Merge branch 'regolith-labs:master' into master
KlementXV Aug 6, 2024
c74c945
Merge branch 'regolith-labs:master' into master
KlementXV Aug 7, 2024
19dfe99
Merge branch 'regolith-labs:master' into master
KlementXV Aug 8, 2024
97fa0eb
chore: Update Dockerfile and entrypoint.sh
KlementXV Aug 8, 2024
22a9536
Merge branch 'regolith-labs:master' into master
KlementXV Aug 8, 2024
1687196
chore: Update Dockerfile
KlementXV Aug 8, 2024
a125a7a
Merge branch 'regolith-labs:master' into master
KlementXV Aug 8, 2024
a056431
Merge branch 'regolith-labs:master' into master
KlementXV Aug 8, 2024
0bab533
Merge branch 'regolith-labs:master' into master
KlementXV Aug 8, 2024
76a384e
Merge branch 'regolith-labs:master' into master
KlementXV Aug 9, 2024
7d17d3c
Merge branch 'regolith-labs:master' into master
KlementXV Aug 9, 2024
2e91ec7
Merge branch 'regolith-labs:master' into master
KlementXV Aug 9, 2024
485164e
fix: Switch from Alpine to UBI9 on Dockerfile due to compatibility is…
KlementXV Aug 9, 2024
91259ac
chore: Update THREAD to CORES in Docker run command for better clarit…
KlementXV Aug 9, 2024
9a3fbd9
chore: Update validate_params function to only check for wallet file …
KlementXV Aug 10, 2024
cbac7b2
chore: Update Dockerfile & entrypoint.sh
KlementXV Aug 10, 2024
4fd6d32
Merge branch 'regolith-labs:master' into master
KlementXV Aug 12, 2024
543e735
chore: Add JITO option
KlementXV Aug 12, 2024
e2248b5
chore: Update Dockerfile to improve build process
KlementXV Aug 12, 2024
569d255
Merge branch 'regolith-labs:master' into master
KlementXV Aug 16, 2024
a491752
chore: changing workflow names
KlementXV Aug 18, 2024
40f383c
Merge branch 'regolith-labs:master' into master
KlementXV Aug 22, 2024
5f675b9
Merge branch 'regolith-labs:master' into master
KlementXV Aug 26, 2024
13e27dc
chore: enhance GitHub workflows with testing, multi-platform builds, …
KlementXV Aug 31, 2024
e09c916
Merge branch 'regolith-labs:master' into master
KlementXV Sep 13, 2024
01ff935
Merge branch 'regolith-labs:master' into master
KlementXV Sep 25, 2024
4fd71a3
Merge branch 'regolith-labs:master' into master
KlementXV Oct 10, 2024
d1a72cf
Resolve conflicts and update README.md
KlementXV Nov 27, 2024
29c8229
Merge branch 'regolith-labs:master' into master
KlementXV Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
target/
dist/
build/
.git/
.github/
.gitignore
*.rs.bk
*.log
*.tmp
*.bak
*.swp
output.log
docs/
tests/
.env
docker-compose.yml
README.md
Dockerfile
148 changes: 0 additions & 148 deletions .github/workflows/build.yml

This file was deleted.

107 changes: 107 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Docker Build

on:
release:
types: [published]

env:
REGISTRY: ghcr.io

jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
image_name: ${{ steps.image_name.outputs.image_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- id: version
run: |
VERSION=$(cargo metadata --no-deps --quiet --color never | jq -r '.packages[].version')
VERSION_LOWER=$(echo "$VERSION" | tr '[:upper:]' '[:lower:]')
echo "version=${VERSION_LOWER}" >> "$GITHUB_OUTPUT"

- id: image_name
run: |
IMAGE_NAME=$(echo "${{ github.repository_owner }}/ore" | tr '[:upper:]' '[:lower:]')
echo "image_name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"

build:
needs: version
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Install cosign
uses: sigstore/[email protected]
with:
cosign-release: 'v2.2.4'

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ needs.version.outputs.image_name }}
tags: |
type=raw,value=${{ needs.version.outputs.version }}
type=raw,value=latest
type=sha

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Sign the images with GitHub OIDC Token
env:
DIGEST: ${{ steps.build-and-push.outputs.digest }}
TAGS: ${{ steps.meta.outputs.tags }}
run: |
images=""
for tag in ${TAGS}; do
images+="${tag}@${DIGEST} "
done
cosign sign --yes ${images}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: '${{ env.REGISTRY }}/${{ needs.version.outputs.image_name }}:${{ needs.version.outputs.version }}'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
wait-for-processing: true
Loading