Skip to content

Docker Image

Docker Image #73

Workflow file for this run

name: Docker Image
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
# once a day
- cron: 0 0 * * *
jobs:
build_and_push_docker_image:
name: Push Docker image to ghcr
runs-on: ubuntu-latest
strategy:
matrix:
include:
- file: Dockerfile
image: ghcr.io/espressosystems/ubuntu-base
- file: nodejs.Dockerfile
image: ghcr.io/espressosystems/nodejs-base
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to Github Container Repo
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate docker metadata
uses: docker/metadata-action@v5
id: metadata
with:
images: ${{ matrix.image }}
- name: Build and push docker
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.file }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: linux/amd64,linux/arm64