test
Some checks failed
Build & Push Docker Image / build-and-push (push) Failing after 3s

This commit is contained in:
2025-11-23 16:27:58 +01:00
parent 9d51bd50f3
commit 44cf5b6607

View File

@@ -1,19 +1,51 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
name: Build & Push Docker Image
run-name: "Build & publish go-micro-service Docker image"
on:
push:
branches:
- main
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
build-and-push:
runs-on: ubuntu-latest # ← must match your Gitea Act Runner label
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: Check out repository code
# ----------------------------------------------------------
# 1. Check out code
# ----------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v4
- 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
# ----------------------------------------------------------
# 2. Set required variables
# ----------------------------------------------------------
- name: Set environment variables
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
echo "REGISTRY=${{ gitea.server_url }}" >> $GITHUB_ENV
echo "IMAGE_NAME=${{ gitea.repository }}" >> $GITHUB_ENV
echo "TAG=latest" >> $GITHUB_ENV
# ----------------------------------------------------------
# 3. Login to Gitea Container Registry
# You must create a secret: GITEA_REGISTRY_TOKEN
# ----------------------------------------------------------
- name: Log in to Gitea Container Registry
run: |
echo "${{ secrets.GITEA_REGISTRY_TOKEN }}" | \
docker login ${{ env.REGISTRY }} \
-u "${{ gitea.actor }}" --password-stdin
# ----------------------------------------------------------
# 4. Build Docker image from your Dockerfile
# ----------------------------------------------------------
- name: Build Docker image
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} .
# ----------------------------------------------------------
# 5. Push Docker image
# ----------------------------------------------------------
- name: Push Docker image
run: |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}