49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: Build on push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
env:
|
|
DOCKER_CLI_EXPERIMENTAL: enabled
|
|
|
|
jobs:
|
|
build:
|
|
name: Build image
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Checkout project
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
- name: Set env variables
|
|
run: echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_ENV
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
id: qemu
|
|
|
|
- name: Setup Docker buildx action
|
|
uses: docker/setup-buildx-action@v1
|
|
id: buildx
|
|
|
|
- name: Show available Docker buildx platforms
|
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
|
|
|
|
|
- name: Run Docker buildx
|
|
run: |
|
|
docker buildx build \
|
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
|
--platform linux/arm64,linux/amd64 \
|
|
--tag ${{ secrets.DOCKER_CONTAINER_USERNAME }}/lndhub:$BRANCH \
|
|
--output "type=registry" ./ |