Skip to content

Dev Image

Dev Image #4

Workflow file for this run

name: Dev Image
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag of the image being built (e.g. dev). Cannot start with "v" or be "latest".'
required: true
permissions:
contents: read
packages: write
jobs:
build-and-push:
if: github.event.inputs.tag != 'latest' && !startsWith(github.event.inputs.tag, 'v')
runs-on: ubuntu-latest
env:
IMAGE_NAME: tugtainer
AGENT_IMAGE_NAME: tugtainer-agent
TAG: ${{ github.event.inputs.tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Metadata App
id: app-meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ env.TAG }}
- name: Docker Metadata Agent
id: agent-meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ secrets.DOCKER_USERNAME }}/${{ env.AGENT_IMAGE_NAME }}
ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.AGENT_IMAGE_NAME }}
tags: |
type=raw,value=${{ env.TAG }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push app image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.app
platforms: linux/amd64
push: true
tags: ${{ steps.app-meta.outputs.tags }}
build-args: |
VERSION=${{ env.TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
labels: |
${{ steps.app-meta.outputs.labels }}
dev.quenary.tugtainer.protected=true
- name: Build and push agent image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.agent
platforms: linux/amd64
push: true
tags: ${{ steps.agent-meta.outputs.tags }}
build-args: |
VERSION=${{ env.TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
labels: |
${{ steps.agent-meta.outputs.labels }}
org.opencontainers.image.title=Tugtainer Agent
org.opencontainers.image.description=Agent part of Tugtainer app, providing secure remote access to Docker hosts
dev.quenary.tugtainer.protected=true