docker-pleroma/.github/workflows/cibuild.yml
Jordan Webb bc7fbb716c
Update Dockerfile (#28)
* Try to make it impossible to confuse arches

* Use GHA cache
2022-05-01 23:06:58 -05:00

69 lines
1.5 KiB
YAML

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: '0 0 1/1 * *'
name: Build
env:
CONTAINER_NAME: jordemort/pleroma:${{ github.event.inputs.container_tag || 'latest' }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
DOCKER_CLI_EXPERIMENTAL: enabled
jobs:
cibuild:
name: Build image
runs-on: ubuntu-20.04
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to container registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- uses: actions/checkout@v3
with:
submodules: recursive
# Needed for buildx gha cache to work
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v1
- name: Build and push container
run: |
buildx_argv=(
--pull
--platform "$PLATFORMS"
--cache-from type=gha
--cache-to type=gha,mode=max
--tag "$CONTAINER_NAME"
)
if [ "${GITHUB_EVENT_NAME:-}" = "push" ] || [ "${GITHUB_EVENT_NAME:-}" = "schedule" ] ; then
buildx_argv+=(--push)
fi
set -x
docker buildx build "${buildx_argv[@]}" .
- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}