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"
env:
GITEA_SERVER_URL: ${{ gitea.server_url }}
printf "https://%s:%s@git.lukas-harat.com\n" \ - name: Build and push
"${{ secrets.GIT_USERNAME }}" \ uses: docker/build-push-action@v5
"${{ secrets.GIT_TOKEN }}" > ~/.git-credentials with:
context: .
- name: Checkout push: true
uses: actions/checkout@v5 tags: ${{ env.REGISTRY }}/${{ gitea.repository }}:latest
- 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 }}."