Update .github/workflows/main.yml

This commit is contained in:
Steffen Illium 2025-05-15 17:51:06 +02:00
parent ca7002c9a5
commit 9cf8f5ab89

View File

@ -8,38 +8,42 @@ jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 - name: Login to Gitea Package Registry
# (Test credentials early, befor failing late in the process.) # (Test credentials early, befor failing late in the process.)
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: http://${{LOCAL_REGISTRY}}:3000 registry: http://${{vars.LOCAL_REGISTRY}}:3000
http: true http: true
username: ${{ gitea.actor }} username: ${{ gitea.actor }}
password: ${{ secrets.TOKEN }} password: ${{ secrets.GITEA_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: '3.3.7' ruby-version: '3.3'
- name: Install GEM bundle - name: Install GEM bundle
run: bundle install run: bundle install
- name: Build Website using Jekyll - 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 - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 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 - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
@ -47,4 +51,6 @@ jobs:
context: . context: .
platforms: linux/amd64 # ,linux/arm64 platforms: linux/amd64 # ,linux/arm64
push: true 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 }}