Compare commits

...

2 Commits

Author SHA1 Message Date
271e8b9c0d fix: Udpate code
Some checks are pending
Build and Publish Docker Image / build (push) Waiting to run
2025-12-26 00:18:58 +00:00
f69c0d6560 fix: Udpate code 2025-12-26 00:18:10 +00:00
4 changed files with 96 additions and 1 deletions

View File

@ -0,0 +1,30 @@
name: Build and Publish Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ gitea.server_url }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ gitea.server_url }}/${{ gitea.repository }}:latest
${{ gitea.server_url }}/${{ gitea.repository }}:${{ gitea.sha }}

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
# Use official Bun image
FROM oven/bun:1-alpine
# Set working directory
WORKDIR /app
# Copy application files
COPY index.ts .
# Run the application
CMD ["bun", "run", "index.ts"]

View File

@ -1,3 +1,54 @@
<<<<<<< HEAD
# Hello World - Bun.js
A simple Hello World application built with Bun.js.
## Run Locally
```bash
bun run index.ts
```
## Run with Docker
Build the image:
```bash
docker build -t hello-bun .
```
Run the container:
```bash
docker run hello-bun
```
## CI/CD Pipeline
This repo includes a Gitea Actions workflow that automatically builds and publishes the Docker image to Gitea's container registry on every push to `main`.
### Setup Required
1. **Enable Actions** in your Gitea repository settings
2. **Create a secret** named `REGISTRY_TOKEN`:
- Go to Repository → Settings → Actions → Secrets
- Add a new secret `REGISTRY_TOKEN` with your Gitea access token
### Pull the Published Image
After the pipeline runs, pull your image:
```bash
docker pull <your-gitea-url>/<owner>/<repo>:latest
```
## Output
```
Hello World! 🌍
```
=======
Test
Test
>>>>>>> origin/main

2
index.ts Normal file
View File

@ -0,0 +1,2 @@
console.log("Hello World! 🌍");