chore: add local build action

This commit is contained in:
Methapon Metanipat 2024-09-12 17:34:18 +07:00
parent 3e3f70bb3c
commit a1515276c7
2 changed files with 62 additions and 0 deletions

31
.github/workflows/local-build-dev.yaml vendored Normal file
View file

@ -0,0 +1,31 @@
name: local-build-dev
# Intended for local network use.
# Remote access is possible if the host has a public IP address.
on:
workflow_dispatch:
env:
REGISTRY: ${{ vars.DOCKER_REGISTRY || 'localhost:5000' }}
jobs:
local-build-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."${{ env.REGISTRY }}"]
http = true
insecure = true
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ env.REGISTRY }}/jws/jws-backend:dev
allow: security.insecure

View file

@ -0,0 +1,31 @@
name: local-build-release
# Intended for local network use.
# Remote access is possible if the host has a public IP address.
on:
workflow_dispatch:
env:
REGISTRY: ${{ vars.DOCKER_REGISTRY || 'localhost:5000' }}
jobs:
local-build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."${{ env.REGISTRY }}"]
http = true
insecure = true
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ env.REGISTRY }}/jws/jws-backend:latest
allow: security.insecure