Skip to content

Build and Publish Docker Image #8

Build and Publish Docker Image

Build and Publish Docker Image #8

name: 'Build and Publish Docker Image'
on:
push:
branches: [main, develop]
paths-ignore: [README.md]
pull_request:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 2 * * MON"
jobs:
build:
name: 'Build and Publish Docker Image'
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/checkout
- name: 'Checkout Code'
uses: actions/checkout@v4
# https://github.com/marketplace/actions/docker-setup-qemu
- name: 'Setup QEMU'
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64 #,linux/arm64,linux/arm/v7
# https://github.com/marketplace/actions/docker-setup-buildx
- name: 'Setup Docker Buildx'
uses: docker/setup-buildx-action@v3
# https://github.com/marketplace/actions/docker-login
- name: 'Login to Docker Hub'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: 'Build and Push docker-prusaslicer'
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: ${{ (github.event_name != 'pull_request') }} #don't push for pull requests
tags: |
vkhurana/docker-prusaslicer:${{ endsWith(github.ref, 'refs/heads/main') && 'latest' || 'develop' }}
build-args: |
LABEL_VERSION=python3