blob: b954689e38d5d4ef2bbadfa9cfe0da82527ea3f2 [file] [log] [blame]
# 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@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to the Github Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
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