You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
name: build
|
|
|
|
on:
|
|
push:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- v*
|
|
- latest
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3.3.0
|
|
with:
|
|
submodules: true
|
|
|
|
- uses: docker/setup-qemu-action@v1.1.0
|
|
- uses: docker/setup-buildx-action@v1.3.0
|
|
- uses: docker/login-action@v1.9.0
|
|
with:
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
- name: check and set image version
|
|
id: prepare
|
|
run: |
|
|
case ${{ github.ref }} in
|
|
refs/heads/master)
|
|
echo ::set-output name=version::edge
|
|
echo ::set-output name=push::true
|
|
;;
|
|
refs/tags/*)
|
|
echo ::set-output name=version::$(echo ${{ github.ref }} | sed -E 's|refs/tags/||')
|
|
echo ::set-output name=push::true
|
|
;;
|
|
*)
|
|
echo ::set-output name=version::${{ github.sha }}
|
|
echo ::set-output name=push::false
|
|
;;
|
|
esac;
|
|
|
|
- name: build & push image
|
|
uses: docker/build-push-action@v2.4.0
|
|
with:
|
|
context: .
|
|
file: docker/alpine/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ steps.prepare.outputs.push }}
|
|
tags: ${{ github.repository }}:${{ steps.prepare.outputs.version }}
|