feat: add Docker support and Gitea publish workflow
All checks were successful
Build and Publish Docker Image / deploy (push) Successful in 1m38s
All checks were successful
Build and Publish Docker Image / deploy (push) Successful in 1m38s
- Add a multi-stage Dockerfile for building and running the Go backend - Add .dockerignore to optimize the Docker build context - Create a Gitea Actions workflow to build and publish Docker images on tag push - Register a new `/health` endpoint for container healthchecks - Update README.md with Docker and Podman deployment instructions - Ignore local `docker-compose.yml` in .gitignore
This commit is contained in:
46
.gitea/workflows/publish.yml
Normal file
46
.gitea/workflows/publish.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Build and Publish Docker Image
|
||||
run-name: Publishing ${{ gitea.ref_name }}
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: backend/go.mod
|
||||
cache: false
|
||||
|
||||
- name: Run Tests
|
||||
run: cd backend && go test ./...
|
||||
|
||||
- name: Install Docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg APP_VERSION=${{ gitea.ref_name }} \
|
||||
-t tea.chunkbyte.com/kato/warpbox-dev:${{ gitea.ref_name }} \
|
||||
-t tea.chunkbyte.com/kato/warpbox-dev:latest \
|
||||
.
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: tea.chunkbyte.com
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Push Docker Image
|
||||
run: |
|
||||
docker push tea.chunkbyte.com/kato/warpbox-dev:${{ gitea.ref_name }}
|
||||
docker push tea.chunkbyte.com/kato/warpbox-dev:latest
|
||||
Reference in New Issue
Block a user