From 0ad4e26e0c5ae7bbd89d4f4a2962a665fba6edd2 Mon Sep 17 00:00:00 2001 From: lukas Date: Thu, 27 Aug 2026 11:29:33 +0200 Subject: [PATCH] wip --- .gitea/workflows/ci.yml | 55 +++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d093644..87a8c55 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,31 +1,38 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] +name: Build and Push Container + +on: + push: + branches: + - main jobs: - Explore-Gitea-Actions: + build: runs-on: ubuntu-latest + steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Checkout repository + uses: actions/checkout@v4 - - name: Configure Git credentials + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: ${{ gitea.server_url }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Set registry + shell: bash run: | - git config --global credential.helper store - git config --global credential.https://git.lukas-harat.com.username "${{ secrets.GIT_USERNAME }}" - git config --global credential.https://git.lukas-harat.com.password "${{ secrets.GIT_TOKEN }}" - - printf "https://%s:%s@git.lukas-harat.com\n" \ - "${{ secrets.GIT_USERNAME }}" \ - "${{ secrets.GIT_TOKEN }}" > ~/.git-credentials + REGISTRY="${GITEA_SERVER_URL}" + REGISTRY="${REGISTRY#http://}" + REGISTRY="${REGISTRY#https://}" + echo "REGISTRY=$REGISTRY" >> "$GITHUB_ENV" + env: + GITEA_SERVER_URL: ${{ gitea.server_url }} - - name: Checkout - uses: actions/checkout@v5 - - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ env.REGISTRY }}/${{ gitea.repository }}:latest \ No newline at end of file