2021-03-06 12:31:31 +01:00
|
|
|
name: build docker image
|
|
|
|
|
|
|
|
on:
|
2021-03-06 12:53:45 +01:00
|
|
|
workflow_dispatch:
|
2021-03-06 12:31:31 +01:00
|
|
|
push:
|
|
|
|
branches:
|
2021-03-06 12:42:35 +01:00
|
|
|
- "**"
|
2021-03-06 12:31:31 +01:00
|
|
|
tags:
|
2021-03-16 19:59:46 +01:00
|
|
|
- "**"
|
2021-03-06 12:31:31 +01:00
|
|
|
|
|
|
|
jobs:
|
2021-03-06 13:28:03 +01:00
|
|
|
test:
|
2023-01-19 19:57:03 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2021-03-06 12:31:31 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout the code
|
2023-09-05 06:59:56 +02:00
|
|
|
uses: actions/checkout@v4
|
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:
|
2023-01-19 19:57:03 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2021-03-07 13:05:22 +01:00
|
|
|
needs: test
|
2021-03-06 13:28:03 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout the code
|
2023-09-05 06:59:56 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-03-06 13:03:08 +01:00
|
|
|
# https://github.com/docker/setup-qemu-action
|
|
|
|
- name: Set up QEMU
|
2023-09-15 19:07:34 +02:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2021-03-06 13:03:08 +01:00
|
|
|
# https://github.com/docker/setup-buildx-action
|
|
|
|
- name: Set up Docker Buildx
|
2023-09-13 07:03:02 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-03-06 12:31:31 +01:00
|
|
|
- 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
|
2021-03-06 12:31:31 +01:00
|
|
|
- name: Login to Docker Hub
|
2023-09-15 19:56:06 +02:00
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2021-03-06 12:31:31 +01:00
|
|
|
- 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 }} \
|
2021-03-06 12:31:31 +01:00
|
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|