48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Buildx Docker image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
inputs:
|
|
logLevel:
|
|
description: 'Log level'
|
|
required: false
|
|
default: 'warning'
|
|
|
|
jobs:
|
|
buildx:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Get current date
|
|
id: date
|
|
run: echo "::set-output name=today::$(date +'%Y-%m-%d')"
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6
|
|
push: true
|
|
tags: |
|
|
user/app:latest
|
|
user/app:${{ steps.date.outputs.today }} |