0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-01-08 08:14:38 +01:00

build env

This commit is contained in:
moslem-asaad 2025-02-22 18:49:23 +02:00
parent 581e52b3e7
commit b683dd8571

44
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Build and Test
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go environment
uses: actions/setup-go@v3
with:
go-version: '1.19'
- name: Install dependencies
run: go mod download
- name: Run unit tests
run: go test ./... -v
- name: Run linting
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run
- name: Build Docker image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/gitea:latest .
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/gitea:latest