52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
---
|
|
name: 'Build PHP Latest Images'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Prepare Image Build
|
|
id: prep_image
|
|
run: |
|
|
DOCKER_IMAGE=ghcr.io/${{ github.actor }}/borg-server
|
|
TAG="${DOCKER_IMAGE}:latest"
|
|
|
|
# Set output parameters.
|
|
echo ::set-output name=tags::${TAG}
|
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@master
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
# platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@master
|
|
|
|
- name: Log in to the GitHub Container registry
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build Image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.prep_image.outputs.tags }}
|