Skip to content

feat: add version string to templates #33

feat: add version string to templates

feat: add version string to templates #33

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tox:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: kitamanager
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
python: ["3.10"]
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install tox and any other packages
run: pip install tox
- uses: actions/checkout@v2
- name: Run tox
run: |
# the content of the dev-progres env vars must match what is set wtih POSTGRES_{PASSWORD,USER}
source kitamanager-env-dev-postgres
tox
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set django-kitamanager version env
run: |
pip install setuptools_scm
echo "DJANGO_KITAMANAGER_VERSION=$(cd django-kitamanager && python -m setuptools_scm)" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/eenemeene/kitamanager
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
build-args: |
"VERSION=${{ env.DJANGO_KITAMANAGER_VERSION }}"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}