This commit is contained in:
2026-08-27 11:29:33 +02:00
parent fa425beef7
commit 0ad4e26e0c
+31 -24
View File
@@ -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 }}."
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ gitea.repository }}:latest