-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions config to build 3.12
- Loading branch information
1 parent
faf2ad1
commit c15f1b0
Showing
3 changed files
with
62 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build Images | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Build image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date -u +'%Y-%m-%dT%H:%m:%SZ')" | ||
- name: Buildah Action | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: python | ||
tags: 3.12 3.12-${{ github.sha }} | ||
containerfiles: | | ||
./3.12/Dockerfile | ||
build-args: | | ||
BUILD_DATE=${{ steps.date.outputs.date }} | ||
VCS_REF=${{ github.sha }} | ||
POETRY_VERSION=1.8.4 | ||
- name: Test the image | ||
run: | | ||
podman run \ | ||
-it \ | ||
--volume $(pwd):/var/www/app:rw \ | ||
--user dev \ | ||
localhost/python:3.12 \ | ||
bash ./test.sh | ||
- name: Push To docker.io | ||
id: push-to-dockerio | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: docker.io/groovytron | ||
username: groovytron | ||
password: ${{ secrets.REGISTRY_TOKEN }} | ||
|
||
- name: Print image url | ||
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,24 @@ | ||
#!/bin/bash | ||
|
||
PROJECT_NAME=testsite | ||
PIPENV_PROJECT_DIR=test_pipenv | ||
POETRY_PROJECT_DIR=test_poetry | ||
|
||
python --version | ||
python3 --version | ||
pip --version | ||
pip3 --version | ||
pipenv --version | ||
poetry --version | ||
|
||
# Create repository folders | ||
mkdir -p "$PIPENV_PROJECT_DIR" "$POETRY_PROJECT_DIR" | ||
|
||
# Pipenv test | ||
cd "$PIPENV_PROJECT_DIR" | ||
|
||
pipenv install django || exit 1 | ||
echo 'Creating test django project with pipenv...' | ||
|
||
pipenv run django-admin startproject "$PROJECT_NAME" || exit 1 | ||
echo 'Django project created with pipenv.' | ||
|
||
# Poetry test | ||
cd "../$POETRY_PROJECT_DIR" | ||
|
||
poetry init --no-interaction | ||
|
||
poetry add Django || exit 1 | ||
echo 'Creating test django project using poetry...' | ||
|
||
poetry run django-admin startproject "$PROJECT_NAME" || exit 1 | ||
echo 'Django project created with poetry.' | ||
# PROJECT_NAME=testsite | ||
# POETRY_PROJECT_DIR=test_poetry | ||
# | ||
# # Create repository folders | ||
# mkdir -p "$POETRY_PROJECT_DIR" | ||
# | ||
# # Poetry test | ||
# cd "$POETRY_PROJECT_DIR" || exit 1 | ||
# | ||
# poetry init --no-interaction | ||
# | ||
# poetry add Django || exit 1 | ||
# echo 'Creating test django project using poetry...' | ||
# | ||
# poetry run django-admin startproject "$PROJECT_NAME" || exit 1 | ||
# echo 'Django project created with poetry.' |