Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
02fa5a3
Create docker-publish.yml
matyii Feb 12, 2025
860684a
Update docker-publish.yml
matyii Feb 12, 2025
6633537
Merge pull request #7 from screeniehost/development
matyii Feb 12, 2025
d15f6b9
Update docker-publish.yml
matyii Feb 12, 2025
c1f0044
Update docker-publish.yml
matyii Feb 12, 2025
3ccd977
Merge pull request #8 from screeniehost/development
matyii Feb 12, 2025
ce7a431
Update docker-publish.yml
matyii Feb 12, 2025
0ef23b2
Update docker-publish.yml
matyii Feb 12, 2025
d3aa214
Update docker-publish.yml
matyii Feb 12, 2025
f1d1c5e
Update docker-publish.yml
matyii Feb 12, 2025
4dff260
Update docker-publish.yml
matyii Feb 12, 2025
0eb9361
Update docker-publish.yml
matyii Feb 12, 2025
ed9cd75
Update docker-publish.yml
matyii Feb 12, 2025
13f4e55
Update docker-publish.yml
matyii Feb 12, 2025
047b015
Update docker-publish.yml
matyii Feb 12, 2025
77d2f8c
Update docker-publish.yml
matyii Feb 12, 2025
4e6b031
Update docker-publish.yml
matyii Feb 12, 2025
ee5ff1f
Update docker-publish.yml
matyii Feb 12, 2025
d72437b
Update docker-publish.yml
matyii Feb 12, 2025
8218af8
Merge pull request #9 from screeniehost/development
matyii Feb 12, 2025
cf94517
Merge pull request #10 from screeniehost/development
matyii Feb 12, 2025
f595eff
Update docker-publish.yml
matyii Feb 13, 2025
51d797e
Update docker-publish.yml
matyii Feb 13, 2025
d3bf02c
Update docker-publish.yml
matyii Feb 13, 2025
e61f4fe
fixing the docker image building
matyii Feb 18, 2025
bdd482c
i hate docker
matyii Feb 18, 2025
8ea67bd
.
matyii Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build Release Docker image

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build'
required: true
default: 'main'
type: choice
options:
- main
- development

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- 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 the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}

- name: Get release metadata
id: release-meta
run: |
version=$(jq -r .version package.json || echo "0.0.0")
commit_short=$(git rev-parse --short HEAD)
echo "commit_short=$commit_short" >> $GITHUB_OUTPUT
echo "version=$version" >> $GITHUB_OUTPUT

- name: Read versions from versions.json
id: read-versions
run: |
latest=$(jq -r .latest versions.json)
beta=$(jq -r .beta versions.json)
echo "latest=$latest" >> $GITHUB_OUTPUT
echo "beta=$beta" >> $GITHUB_OUTPUT

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=raw,value=${{ github.event.inputs.branch == 'main' && steps.read-versions.outputs.latest || steps.read-versions.outputs.beta }}
type=raw,value=${{ github.event.inputs.branch == 'main' && 'latest' || 'beta' }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Debug metadata output
run: |
echo "Tags: ${{ steps.meta.outputs.tags }}"
echo "Labels: ${{ steps.meta.outputs.labels }}"

- name: Build and push Docker image for main branch
if: github.event.inputs.branch == 'main'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.read-versions.outputs.latest }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push Docker image for development branch
if: github.event.inputs.branch == 'development'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.read-versions.outputs.beta }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:beta
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Loading
Loading