2 Commits

Author SHA1 Message Date
941aedc208 feat: Initial Commit 2025-02-15 07:03:23 +13:00
0c0ef17fb6 chore: Initial Pipeline 2025-02-15 07:02:55 +13:00
3 changed files with 92 additions and 0 deletions

26
.github/build.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: CI
on:
push:
branches:
- "**"
tags:
- "!**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Create release if required
uses: go-semantic-release/action@v1
with:
custom-arguments: --provider=gitea
hooks: exec
env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}}

38
.github/release.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: CI
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Get Vars
run: |
echo ${GITHUB_REF_NAME}
echo ${GITHUB_REF_TYPE}
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: >
linux/amd64,
linux/arm64
push: true
tags: >
${{ secrets.DOCKERHUB_USERNAME }}/ara-api:latest,
${{ secrets.DOCKERHUB_USERNAME }}/ara-api:${{ env.GITHUB_REF_NAME }}

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
FROM almalinux:9.5-minimal
ARG DEV_DEPENDENCIES="gcc python3-devel postgresql-devel mariadb-devel"
RUN dnf update -y \
&& dnf install -y which \
python3-pip \
python3-wheel \
postgresql \
libpq \
mariadb-connector-c
# Install development dependencies required for installing packages from PyPI
RUN dnf install -y ${DEV_DEPENDENCIES}
# Install ara from PyPI with API server extras for dependencies (django & django-rest-framework)
# including database backend libraries and gunicorn
RUN python3 -m pip install "ara[server,postgresql,mysql]" gunicorn
# Remove development dependencies and clean up
RUN dnf remove -y ${DEV_DEPENDENCIES} \
&& dnf autoremove -y \
&& dnf clean all \
&& python3 -m pip cache purge
# Set up the container to execute SQL migrations and run the API server with gunicorn
ENV ARA_BASE_DIR=/opt/ara
CMD ["bash", "-c", "/usr/local/bin/ara-manage migrate && python3 -m gunicorn --workers=4 --access-logfile - --bind 0.0.0.0:8000 ara.server.wsgi" ]
EXPOSE 8000