Testing #29

Merged
pi-ux-ce merged 3 commits from testing into main 2026-08-26 10:15:47 +00:00
2 changed files with 30 additions and 53 deletions
+14 -36
View File
@@ -1,4 +1,4 @@
name: Gitea Actions Demo name: Dockerfile runner
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: on:
push: push:
@@ -56,23 +56,6 @@ jobs:
echo "------------------------------------------------" echo "------------------------------------------------"
echo "Next version: $next_version" echo "Next version: $next_version"
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /opt/hostedtoolcache/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: inject cache into docker
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
with:
cache-source: /opt/hostedtoolcache/pip
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to gitea - name: Login to gitea
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
@@ -80,25 +63,20 @@ jobs:
username: ${{ secrets.USERNAME_GITEA }} username: ${{ secrets.USERNAME_GITEA }}
password: ${{ secrets.PASSWORD_GITEA }} password: ${{ secrets.PASSWORD_GITEA }}
- name: Build and push - name: Build image
uses: docker/build-push-action@v6
with:
context: .
file: infra/production/dockerfile
push: true
build-args: |
ALLOWED_HOSTS='django.tryton.geeraert.eu'
DEBUG='True'
tags: |
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }}
cache-from: type=local,src=/opt/hostedtoolcache/.buildx-cache
cache-to: type=local,dest=/opt/hostedtoolcache/.buildx-cache-new,mode=max
- name: Move cache
run: | run: |
rm -rf /opt/hostedtoolcache/.buildx-cache docker build \
mv /opt/hostedtoolcache/.buildx-cache-new /opt/hostedtoolcache/.buildx-cache -f infra/production/dockerfile \
--build-arg ALLOWED_HOSTS='django.tryton.geeraert.eu' \
--build-arg DEBUG='True' \
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest \
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }} \
.
- name: Push image
run: |
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }}
- name: Rollout Django to force pulling the new image - name: Rollout Django to force pulling the new image
uses: actions-hub/kubectl@master uses: actions-hub/kubectl@master
+16 -17
View File
@@ -1,4 +1,4 @@
name: Gitea Actions Demo name: Dockerfile testing runner
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: on:
push: push:
@@ -22,9 +22,6 @@ jobs:
- name: List files in the repository - name: List files in the repository
run: | run: |
ls ${{ gitea.workspace }} ls ${{ gitea.workspace }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Compute next version - name: Compute next version
id: versioning id: versioning
run: | run: |
@@ -43,19 +40,21 @@ jobs:
username: ${{ secrets.USERNAME_GITEA }} username: ${{ secrets.USERNAME_GITEA }}
password: ${{ secrets.PASSWORD_GITEA }} password: ${{ secrets.PASSWORD_GITEA }}
- name: Build and push - name: Build image
uses: docker/build-push-action@v6 run: |
with: docker build \
context: . -f infra/testing/dockerfile \
file: infra/testing/dockerfile --build-arg ALLOWED_HOSTS='django-testing.tryton.geeraert.eu' \
push: true --build-arg DEBUG='True' \
build-args: | --build-arg CACHE_BUST=${{ env.next_version }} \
ALLOWED_HOSTS='django-testing.tryton.geeraert.eu' -t gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:latest \
DEBUG='True' -t gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }} \
CACHE_BUST=${{ env.next_version }} .
tags: |
gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:latest - name: Push image
gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }} 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 - name: update version in the variable
run: | run: |