2021-05-14 04:18:24 +00:00
|
|
|
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' }}
|
|
|
|
CACHE_NAME: jordemort/pleroma:cache-unzip
|
|
|
|
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
|
2021-05-27 14:25:17 +00:00
|
|
|
uses: docker/setup-qemu-action@v1.2.0
|
2021-05-14 04:18:24 +00:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1.3.0
|
|
|
|
|
|
|
|
- name: Login to container registry
|
2021-06-25 19:39:28 +00:00
|
|
|
uses: docker/login-action@v1.10.0
|
2021-05-14 04:18:24 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Pull cached containers
|
|
|
|
run: |
|
|
|
|
docker pull --platform "$PLATFORMS" --quiet "$CONTAINER_NAME" || true
|
|
|
|
docker pull --platform "$PLATFORMS" --quiet "$CACHE_NAME" || true
|
|
|
|
|
|
|
|
- name: Build and push container
|
|
|
|
run: |
|
|
|
|
buildx_argv=(
|
|
|
|
--pull
|
|
|
|
--build-arg BUILDKIT_INLINE_CACHE=1
|
|
|
|
--platform "$PLATFORMS"
|
|
|
|
--cache-from "$CONTAINER_NAME"
|
|
|
|
--tag "$CONTAINER_NAME"
|
|
|
|
)
|
|
|
|
|
|
|
|
if [ "${GITHUB_EVENT_NAME:-}" = "push" ] || [ "${GITHUB_EVENT_NAME:-}" = "schedule" ] ; then
|
|
|
|
buildx_argv+=(--push)
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -x
|
|
|
|
docker buildx build "${buildx_argv[@]}" --target unzip .
|
|
|
|
docker buildx build "${buildx_argv[@]}" .
|
|
|
|
|
|
|
|
- uses: sarisia/actions-status-discord@v1
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|