Skip to content

Merge pull request #3 from edenia/feat/add-docker-build #1

Merge pull request #3 from edenia/feat/add-docker-build

Merge pull request #3 from edenia/feat/add-docker-build #1

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/libre-blocks-explorer:latest
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/libre-blocks-explorer:cache
cache-to: type=inline
build-args: |
NEXT_PUBLIC_LIBRE_API=https://dashboard-api.libre.org
NEXT_PUBLIC_MAINNET_API=https://lb.libre.org
NEXT_PUBLIC_TESTNET_API=https://testnet.libre.org
NEXT_PUBLIC_PROVIDERBY=Libre
NEXT_PUBLIC_PROVIDER_LOGO=/images/provider.png
NEXT_PUBLIC_PROVIDER_LINK=https://libre.org/
- name: Verify Built Image
run: docker run --rm ghcr.io/${{ github.repository }}/libre-blocks-explorer:latest