Skip to content

Build Docker image

Build Docker image #31

name: "Build Docker image - ubuntu-cinnamon"
description: "Builds the Docker image for the Ubuntu Cinnamon Webtop and pushes it to the GitHub Container Registry and Docker Hub."
on:
[workflow_dispatch]
permissions:
contents: read
packages: write
jobs:
get_date:
name: Get current date in RFC 3339
runs-on: ubuntu-latest
outputs:
IMG_DATE: ${{ steps.date.outputs.IMG_DATE }}
steps:
- name: Get current date in RFC 3339
id: date
run: |
IMG_DATE=$(date --rfc-3339=seconds | sed 's/ /T/')
echo "IMG_DATE=${IMG_DATE}" >> $GITHUB_OUTPUT
echo "The date is $IMG_DATE"
build_push:
name: Build and push image
runs-on: ubuntu-latest
needs: get_date
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'ubuntu-cinnamon'
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: tibor309
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: tibordev
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image for amd64/arm64
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile
push: true
build-args: |
IMAGE_BUILD_DATE=${{ needs.get_date.outputs.IMG_DATE }}
tags: |
ghcr.io/tibor309/webtop:latest
tibordev/webtop:ubuntu-cinnamon