Docker Image Build #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image Build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# Have at least one build per month for up-to-date dependencies | |
- cron: '1 1 1 * *' | |
workflow_dispatch: | |
inputs: | |
branches: | |
description: 'Branche' | |
required: true | |
default: 'master' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: crazy-max/ghaction-docker-buildx@v1 | |
with: | |
buildx-version: latest | |
qemu-version: latest | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: login to docker hub | |
run: echo "${{ secrets.DOCKER_HUB_PASS }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin | |
- name: Run Buildx | |
run: | | |
docker buildx build \ | |
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ | |
--tag p3tr/samba-dc:latest \ | |
--output "type=image,push=true" \ | |
--file ./Dockerfile . | |
# | |
# - name: Customizable Docker Buildx Build | |
# uses: zmingxie/[email protected] | |
# with: | |
# # Tags (comma separated) to apply to the image | |
# tag: latest | |
# # Name of the image | |
# imageName: samba-dc | |
# # Name of the Dockerfile | |
# dockerFile: Dockerfile | |
# # Docker `--build-arg` flags (*comma separated*) | |
# # buildArg: # optional, default is none | |
# # Indicate if the builded image should be published on Docker HUB | |
# publish: true | |
# # Platforms (comma separated) that should be used to build the image | |
# platform: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 | |
# # User that will publish the image, if indicated | |
# dockerHubUser: ${{ secrets.DOCKER_HUB_USER }} | |
# # Password of the dockerHubUser | |
# dockerHubPassword: ${{ secrets.DOCKER_HUB_PASS }} | |
# |