Files
Django_kube/.gitea/workflows/dockerfile_testing_runner.yaml
T
pi-ux-ce 8865052752
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
use this method
2026-08-26 11:05:45 +01:00

74 lines
2.7 KiB
YAML

name: Dockerfile testing runner
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on:
push:
branches:
- "testing"
paths:
- 'infra/testing/dockerfile'
tags-ignore:
- '*'
workflow_dispatch: # Enables the manual run UI button
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- name: Compute next version
id: versioning
run: |
latest="${{ vars.VERSION_TESTING }}"
next_version=$(echo "$latest" | awk -F. -v OFS=. '{$NF += 1 ; print}')
echo "next_version=$next_version" >> $GITHUB_ENV
echo "Variables used :"
echo "------------------------------------------------"
echo "Next version: $next_version"
- name: Login to gitea
uses: docker/login-action@v3
with:
registry: gitea.tryton.geeraert.eu
username: ${{ secrets.USERNAME_GITEA }}
password: ${{ secrets.PASSWORD_GITEA }}
- name: Build image
run: |
docker build \
-f infra/testing/dockerfile \
--build-arg ALLOWED_HOSTS='django-testing.tryton.geeraert.eu' \
--build-arg DEBUG='True' \
--build-arg CACHE_BUST=${{ env.next_version }} \
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:latest \
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }} \
.
- name: Push image
run: |
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:latest
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }}
- name: update version in the variable
run: |
curl -X PUT -H "Content-Type: application/json" \
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
https://gitea.tryton.geeraert.eu/api/v1/repos/pi-ux-ce/${{ github.event.repository.name }}/actions/variables/VERSION_TESTING \
-d "{\"Value\":\"$next_version\"}"
- name: Rollout Django to force pulling the new image
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: rollout restart deployment django-testing -n django-testing
- run: echo "🍏 This job's status is ${{ job.status }}."