From 9cf8f5ab89cfdafb6dd3854cd8076303dc7494ba Mon Sep 17 00:00:00 2001 From: Steffen Illium Date: Thu, 15 May 2025 17:51:06 +0200 Subject: [PATCH] Update .github/workflows/main.yml --- .github/workflows/main.yml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80d55862..a9611a84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,38 +8,42 @@ jobs: docker: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Debug: Print Gitea context + run: | + echo "LOCAL_REGISTRY variable is: ${{ vars.LOCAL_REGISTRY }}" + echo "Gitea Actor: ${{ gitea.actor }}" + echo "Repository Owner: ${{ gitea.repository_owner }}" + echo "Repository Name: ${{ gitea.repository_name }}" + echo "SHA: ${{ gitea.sha }}" + echo "Ref: ${{ gitea.ref }}" + echo "Ref Name: ${{ gitea.ref_name }}" + echo "Ref Type: ${{ gitea.ref_type }}" + - name: Login to Gitea Package Registry # (Test credentials early, befor failing late in the process.) uses: docker/login-action@v3 with: - registry: http://${{LOCAL_REGISTRY}}:3000 + registry: http://${{vars.LOCAL_REGISTRY}}:3000 http: true username: ${{ gitea.actor }} - password: ${{ secrets.TOKEN }} - - - name: Checkout - uses: actions/checkout@v4 + password: ${{ secrets.GITEA_TOKEN }} - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.7' + ruby-version: '3.3' - name: Install GEM bundle run: bundle install - name: Build Website using Jekyll - run: bundle exec jekyll build --trace --future + run: JEKYLL_ENV=production bundle exec jekyll build --trace --future - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ gitea.actor }} - password: ${{ secrets.TOKEN }} - name: Build and push uses: docker/build-push-action@v5 @@ -47,4 +51,6 @@ jobs: context: . platforms: linux/amd64 # ,linux/arm64 push: true - tags: gitea_app:3000/steffen/website + tags: | + ${{ vars.REGISTRY_HOST }}/${{ gitea.repository_owner }}/${{ gitea.repository_name }}:latest + ${{ vars.REGISTRY_HOST }}/${{ gitea.repository_owner }}/${{ gitea.repository_name }}:${{ gitea.sha }}