docker-mysql-cron-backup/.github/workflows/image.yml
Fco. Javier Delgado del Hoyo 7c8bb00622 add test to github action
2021-03-06 12:53:45 +01:00

33 lines
No EOL
1,007 B
YAML

name: build docker image
on:
workflow_dispatch:
push:
branches:
- "**"
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Test
run: sudo apt-get -qq update && sudo apt-get install -y devscripts shellcheck && make test
- name: Install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Get latest release version number
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 \
--tag fradelg/mysql-cron-backup:${{ steps.docker-tag.outputs.tag }} \
--platform linux/amd64,linux/arm/v7,linux/arm64 .