blob: 2d9775d8820a7870086ec5c596e0e21f8ce25854 [file]
# Workflow which builds are publishes Docker image used for website development.
# Pre-built image can speed up the development since user doesn't need to build it
# locally first.
name: Build Docker Image
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: "libcloud-site-dev"
jobs:
build_docker_image:
name: Build Docker Image
runs-on: ubuntu-latest
# NOTE: Emulated ARM build is slow...
timeout-minutes: 30
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Log in to the Github Container registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/apache/libcloud-site-dev:latest
cache-from: type=gha
cache-to: type=gha,mode=max