2023-12-11 02:00:07 +00:00
|
|
|
name: Build Docker Image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*.*.*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ghcr-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: shahradelahi/wireadmin
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.PRIVATE_TOKEN }}
|
|
|
|
|
2023-12-15 07:15:36 +00:00
|
|
|
- name: Set Image tag
|
|
|
|
run: |
|
|
|
|
echo "Labeling image with TAG: ${GITHUB_REF#refs/tags/v}"
|
|
|
|
echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
|
|
|
|
2023-12-11 02:00:07 +00:00
|
|
|
- name: Push to GitHub Container Registry
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
push: true
|
|
|
|
platforms: linux/amd64,linux/arm64
|
2023-12-15 07:15:36 +00:00
|
|
|
tags: ghcr.io/${{ env.IMAGE_NAME }}:latest,ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
2023-12-11 02:00:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
docker-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: litehex/wireadmin
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: docker.io
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2023-12-15 07:15:36 +00:00
|
|
|
- name: Set Image tag
|
|
|
|
run: |
|
|
|
|
echo "Labeling image with TAG: ${GITHUB_REF#refs/tags/v}"
|
|
|
|
echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
|
|
|
|
2023-12-11 02:00:07 +00:00
|
|
|
- name: Push to DockerHub
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
push: true
|
|
|
|
platforms: linux/amd64,linux/arm64
|
2023-12-15 07:15:36 +00:00
|
|
|
tags: docker.io/${{ env.IMAGE_NAME }}:latest,docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|