From c65aab8b0672dbe723b65d7e7826218fa5d82a2f Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 12 Sep 2024 17:34:10 +0700 Subject: [PATCH] chore: add local build action --- .github/workflows/local-build-dev.yaml | 31 ++++++++++++++++++++++ .github/workflows/local-build-release.yaml | 31 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/local-build-dev.yaml create mode 100644 .github/workflows/local-build-release.yaml diff --git a/.github/workflows/local-build-dev.yaml b/.github/workflows/local-build-dev.yaml new file mode 100644 index 00000000..db40fcb9 --- /dev/null +++ b/.github/workflows/local-build-dev.yaml @@ -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-frontend:dev + allow: security.insecure diff --git a/.github/workflows/local-build-release.yaml b/.github/workflows/local-build-release.yaml new file mode 100644 index 00000000..ec155026 --- /dev/null +++ b/.github/workflows/local-build-release.yaml @@ -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-frontend:latest + allow: security.insecure