This commit is contained in:
Shahrad Elahi
2024-01-08 12:29:54 +03:30
parent 3432dce042
commit 5a67dd3838
10 changed files with 1950 additions and 95 deletions

View File

@@ -1,16 +1,23 @@
name: Build Docker Image
name: Build Prerelease Image
on:
push:
branches:
- "master"
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: false
env:
BUILD_PLATFORMS: linux/amd64,linux/arm64
IMAGE_TAG: canary-${{ github.event.inputs.tag || github.sha }}
permissions:
contents: read
packages: write
jobs:
ghcr-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
IMAGE_NAME: shahradelahi/wireadmin
@@ -32,15 +39,12 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ env.IMAGE_NAME }}:canary-${{ github.sha }}
platforms: ${{ env.BUILD_PLATFORMS }}
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
docker-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
IMAGE_NAME: litehex/wireadmin
@@ -62,5 +66,5 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: docker.io/${{ env.IMAGE_NAME }}:canary-${{ github.sha }}
platforms: ${{ env.BUILD_PLATFORMS }}
tags: docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

View File

@@ -1,16 +1,19 @@
name: Build Docker Image
on:
push:
tags:
- "v*.*.*"
release:
types: [ created ]
env:
BUILD_PLATFORMS: linux/amd64,linux/arm64
permissions:
contents: read
packages: write
jobs:
ghcr-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
IMAGE_NAME: shahradelahi/wireadmin
@@ -26,8 +29,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.PRIVATE_TOKEN }}
- name: Set Image tag
run: |
- run: |
echo "Labeling image with TAG: ${GITHUB_REF#refs/tags/v}"
echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
@@ -37,7 +39,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ env.BUILD_PLATFORMS }}
tags: ghcr.io/${{ env.IMAGE_NAME }}:latest,ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
@@ -61,8 +63,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Image tag
run: |
- run: |
echo "Labeling image with TAG: ${GITHUB_REF#refs/tags/v}"
echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
@@ -72,5 +73,5 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ env.BUILD_PLATFORMS }}
tags: docker.io/${{ env.IMAGE_NAME }}:latest,docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}