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 name: Build and Push Container
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push] on:
push:
branches:
- main
jobs: jobs:
Explore-Gitea-Actions: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - name: Checkout repository
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" uses: actions/checkout@v4
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- 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: | run: |
git config --global credential.helper store REGISTRY="${GITEA_SERVER_URL}"
git config --global credential.https://git.lukas-harat.com.username "${{ secrets.GIT_USERNAME }}" REGISTRY="${REGISTRY#http://}"
git config --global credential.https://git.lukas-harat.com.password "${{ secrets.GIT_TOKEN }}" REGISTRY="${REGISTRY#https://}"
echo "REGISTRY=$REGISTRY" >> "$GITHUB_ENV"
printf "https://%s:%s@git.lukas-harat.com\n" \ env:
"${{ secrets.GIT_USERNAME }}" \ GITEA_SERVER_URL: ${{ gitea.server_url }}
"${{ secrets.GIT_TOKEN }}" > ~/.git-credentials
- name: Checkout - name: Build and push
uses: actions/checkout@v5 uses: docker/build-push-action@v5
with:
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." context: .
- run: echo "🖥️ The workflow is now ready to test your code on the runner." push: true
- name: List files in the repository tags: ${{ env.REGISTRY }}/${{ gitea.repository }}:latest
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."