Skip to content
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Gitea CI Workflow

on:
push:
branches:
- dev # Trigger on push to the dev branch

jobs:
build:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the code from the repository
- name: Checkout repository
uses: actions/checkout@v2

# Step 2: Set up Go (Gitea is written in Go)
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.24.0' # Use the Go version that Gitea supports

# Step 3: Install dependencies
- name: Install dependencies
run: |
go mod tidy



Check failure on line 29 in .github/workflows/build.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

29:1 [empty-lines] too many blank lines (3 > 1)
docker:
runs-on: ubuntu-latest
needs: build # This will wait until the 'build' job is finished

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v2

# Step 2: Set up Docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Step 3: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }} # Store your Docker username as a secret in GitHub
password: ${{ secrets.DOCKER_PASSWORD }} # Store your Docker password as a secret in GitHub

# Step 4: Build the Docker image
- name: Build Docker image
run: |
docker build -t maias816/gitea:latest .

# Step 5: Push the Docker image to Docker Hub
- name: Push Docker image
run: |
docker push maias816/gitea:latest
Loading