diff --git a/.gitea/workflows/dockerfile_runner.yaml b/.gitea/workflows/dockerfile_runner.yaml index fa0be45..83f4208 100644 --- a/.gitea/workflows/dockerfile_runner.yaml +++ b/.gitea/workflows/dockerfile_runner.yaml @@ -1,4 +1,4 @@ -name: Gitea Actions Demo +name: Dockerfile runner run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 on: push: @@ -56,23 +56,6 @@ jobs: echo "------------------------------------------------" 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 uses: docker/login-action@v3 with: @@ -80,25 +63,20 @@ jobs: username: ${{ secrets.USERNAME_GITEA }} password: ${{ secrets.PASSWORD_GITEA }} - - name: Build and push - 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 + - name: Build image run: | - rm -rf /opt/hostedtoolcache/.buildx-cache - mv /opt/hostedtoolcache/.buildx-cache-new /opt/hostedtoolcache/.buildx-cache + docker build \ + -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 uses: actions-hub/kubectl@master