Skip to content

Build Ubuntu 20.04 Image #126

Build Ubuntu 20.04 Image

Build Ubuntu 20.04 Image #126

name: Build Ubuntu 20.04 Image
on:
push:
branches:
- main
paths:
- 'ubuntu-20.04/*'
- '.github/workflows/build-ubuntu-20.04.yml'
pull_request:
workflow_dispatch:
schedule:
- cron: '30 12 * * 5'
concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Context for Buildx
id: buildx-context
run: |
docker context create builders
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
endpoint: builders
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
chianetwork/ubuntu-20.04-builder
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=sha,format=long
- name: Build Docker Container
uses: docker/build-push-action@v4
with:
context: ./ubuntu-20.04
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}