Skip to content

change to use local python #47

change to use local python

change to use local python #47

Workflow file for this run

name: Staging Docker Image
on:
push:
branches:
- main
- 31-docker
jobs:
build:
runs-on: self-hosted
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: /usr/bin/python3 # Adjust as needed
- name: Install toml package
run: |
python -m pip install toml
- name: Extract version from pyproject.toml
id: extract_version
run: |
import toml
with open('pyproject.toml', 'r') as f:
config = toml.load(f)
version = config['project']['version']
print(f"::set-output name=version::{version}")
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/econlabs/econlabs/jp-api:testing
ghcr.io/econlabs/econlabs/jp-api:${{ steps.extract_version.outputs.version }}
build-args: |
VERSION=${{ steps.extract_version.outputs.version }}