add workflows
Some checks failed
Test / Print content (push) Successful in 17s
Docker Build Demo / Build-Docker-Image (push) Failing after 6s

This commit is contained in:
2026-02-18 16:23:20 +11:00
parent 5b626fead1
commit d1f1e59c18
2 changed files with 46 additions and 0 deletions

13
.gitea/workflows/demo.yml Normal file
View File

@@ -0,0 +1,13 @@
name: Test
run-name: ${{ gitea.actor }} greets Habr!
on: [push]
jobs:
print-content:
name: Print content
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: list directory contents
run: ls -la

View File

@@ -0,0 +1,33 @@
name: Docker Build Demo
# Optional run-name, visible in the Gitea Actions UI
run-name: ${{ github.actor }} is building a Docker image 🚀
# Trigger the workflow on push events
on: push
# Define jobs to run
jobs:
Build-Docker-Image:
# Specify the runner environment
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository code
- name: Checkout Code
uses: actions/checkout@v4
# Step 2: Build the Docker image
- name: Build Docker image
run: |
docker build -t my-image:latest .
# Step 3: Login to a Docker Registry (e.g., Docker Hub or Gitea's registry)
- name: Login to Docker Registry
# Use Gitea secrets for credentials for security
run: echo "${{ secrets.DOCKERPWD }}" | docker login -u "${{ secrets.DOCKERUSER }}" --password-stdin
# Step 4: Tag and Push the Docker image
- name: Push Docker image
run: |
docker tag my-image:latest "${{ secrets.DOCKERUSER }}/dev:latest"
docker push "${{ secrets.DOCKERUSER }}/dev:latest"