Skip to content

Commit

Permalink
add master branch auto build
Browse files Browse the repository at this point in the history
  • Loading branch information
motty-mio2 committed Nov 11, 2023
1 parent 737ef6e commit faeee9b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/build_base.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion deploy/Dockerfile_base → deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand Down

0 comments on commit faeee9b

Please sign in to comment.