|
| 1 | +name: Build and Push Raptoreumd Docker Image |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master, main ] |
| 6 | + paths: |
| 7 | + - 'raptoreum/Dockerfile' |
| 8 | + - '.github/workflows/docker-build-raptoreumd.yml' |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +env: |
| 12 | + REGISTRY: ghcr.io |
| 13 | + IMAGE_NAME: cadenadb/raptoreumd |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-and-push: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + contents: read |
| 20 | + packages: write |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Set up QEMU (for multi-arch builds) |
| 27 | + uses: docker/setup-qemu-action@v3 |
| 28 | + |
| 29 | + - name: Set up Docker Buildx |
| 30 | + uses: docker/setup-buildx-action@v3 |
| 31 | + |
| 32 | + - name: Log in to GitHub Container Registry |
| 33 | + uses: docker/login-action@v3 |
| 34 | + with: |
| 35 | + registry: ${{ env.REGISTRY }} |
| 36 | + username: ${{ github.actor }} |
| 37 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + |
| 39 | + - name: Extract metadata for Docker |
| 40 | + id: meta |
| 41 | + uses: docker/metadata-action@v5 |
| 42 | + with: |
| 43 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 44 | + tags: | |
| 45 | + type=raw,value=latest,enable={{is_default_branch}} |
| 46 | + type=sha,prefix=sha- |
| 47 | +
|
| 48 | + - name: Build and push Docker image |
| 49 | + uses: docker/build-push-action@v5 |
| 50 | + with: |
| 51 | + context: ./raptoreum |
| 52 | + file: ./raptoreum/Dockerfile |
| 53 | + platforms: linux/amd64,linux/arm64 |
| 54 | + push: true |
| 55 | + tags: ${{ steps.meta.outputs.tags }} |
| 56 | + labels: ${{ steps.meta.outputs.labels }} |
| 57 | + cache-from: type=gha |
| 58 | + cache-to: type=gha,mode=max |
0 commit comments