docker-mysql-cron-backup/.github/workflows/image.yml

39 lines
1.2 KiB
YAML
Raw Normal View History

name: build docker image
on:
2021-03-06 12:53:45 +01:00
workflow_dispatch:
push:
branches:
2021-03-06 12:42:35 +01:00
- "**"
tags:
- "v*"
jobs:
2021-03-06 13:28:03 +01:00
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout the code
uses: actions/checkout@v2
2021-03-06 13:28:03 +01:00
- name: Test Bash scripts
2021-03-06 12:53:45 +01:00
run: sudo apt-get -qq update && sudo apt-get install -y devscripts shellcheck && make test
2021-03-06 13:28:03 +01:00
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout the code
uses: actions/checkout@v2
2021-03-06 13:03:08 +01:00
# 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: Get latest release version number
2021-03-06 12:42:35 +01:00
id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build multiarch image
run: |
docker buildx build --push \
2021-03-06 12:42:35 +01:00
--tag fradelg/mysql-cron-backup:${{ steps.docker-tag.outputs.tag }} \
--platform linux/amd64,linux/arm/v7,linux/arm64 .