42 lines
No EOL
1.1 KiB
YAML
42 lines
No EOL
1.1 KiB
YAML
name: Build docker images
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Get tag name
|
|
shell: bash
|
|
run: |
|
|
branch=$(echo ${GITHUB_REF#refs/heads/});
|
|
if [ -z $BRANCH ]; then
|
|
exit 1;
|
|
elif [ $BRANCH == "master" ]; then
|
|
branch=latest;
|
|
fi
|
|
|
|
echo "##[set-output name=tag;]$(echo $branch)"
|
|
id: tag_name
|
|
|
|
# https://github.com/docker/setup-qemu-action
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
# https://github.com/docker/setup-buildx-action
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
- name: login to docker hub
|
|
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
|
|
|
- name: build the image
|
|
run: |
|
|
docker buildx build --push \
|
|
--tag edenhaus/bumper:${{ steps.tag_name.outputs.tag }} \
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 . |