From faeee9ba7e2e3629f062a2728e50c4a533480f54 Mon Sep 17 00:00:00 2001 From: motty Date: Sat, 11 Nov 2023 12:54:07 +0900 Subject: [PATCH] add master branch auto build --- .github/workflows/build_base.yml | 33 ++++++++++++++------------ deploy/{Dockerfile_base => Dockerfile} | 2 +- 2 files changed, 19 insertions(+), 16 deletions(-) rename deploy/{Dockerfile_base => Dockerfile} (88%) diff --git a/.github/workflows/build_base.yml b/.github/workflows/build_base.yml index 68d354f..009aebe 100644 --- a/.github/workflows/build_base.yml +++ b/.github/workflows/build_base.yml @@ -1,11 +1,10 @@ -name: Docker Build and Push +name: Docker Master Build on: workflow_dispatch: push: branches: - master - env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }}_base @@ -19,30 +18,34 @@ jobs: packages: write steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.11 - uses: actions/setup-python@v2 - with: - python-version: "3.11" + - name: Checkout + uses: actions/checkout@v3 - name: get_version + id: build_version run: | - python ./get_var.py + file_path="pyproject.toml" + version=$(awk -F ' = ' '$1=="version" {gsub(/"/, "", $2); print $2}' "$file_path") + echo "VERSION=$version" >> $GITHUB_OUTPUT + + # - 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 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build image - uses: docker/build-push-action@v3 + - name: Build Base image + uses: docker/build-push-action@v5 with: context: . - file: ./deploy/Dockerfile_base - target: ${{ env.REPOSITORY }} + file: ./deploy/Dockerfile push: true + # platforms: linux/amd64,linux/arm64 tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test - # ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.get_version.outputs }} + ${{ env.REGISTRY }}/jphacks/kb_2315/base:master diff --git a/deploy/Dockerfile_base b/deploy/Dockerfile similarity index 88% rename from deploy/Dockerfile_base rename to deploy/Dockerfile index ffe15c1..51b3882 100644 --- a/deploy/Dockerfile_base +++ b/deploy/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim as base +FROM python:3.11-slim WORKDIR /src COPY ../requirements.lock ../pyproject.toml ../README.md /src/