52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version_tag:
|
|
description: 'Version tag (e.g. 1.6, 1.7)'
|
|
required: true
|
|
default: '2.2'
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set image owner to lowercase
|
|
id: owner
|
|
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
no-cache: true
|
|
pull: true
|
|
build-args: |
|
|
COMMIT_SHA=${{ github.sha }}
|
|
tags: |
|
|
ghcr.io/${{ steps.owner.outputs.owner }}/soulsync:latest
|
|
ghcr.io/${{ steps.owner.outputs.owner }}/soulsync:${{ inputs.version_tag || 'dev' }}
|