diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 145b5ed..88f137b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,19 +1,17 @@ name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] +run-name: Deploy 🚀 +on: + push: + branches: + - main jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event.." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner!" - name: List files in the repository run: | ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + + - name: Execute a single command + run: echo "Hello, world!" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..229948e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:latest +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 go build -o main ./cmd/main.go +EXPOSE 3000 +CMD ["./main"] \ No newline at end of file diff --git a/README.md b/README.md index c7c17d9..88bfbc3 100644 --- a/README.md +++ b/README.md @@ -1 +1,24 @@ -# Hello world \ No newline at end of file +# Hello world + +```Bash +FROM golang:tip-trixie AS builder +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 go build -o main ./cmd/main.go + +# --- Stage 2: Runner --- +FROM alpine:latest +WORKDIR /app +COPY --from=builder /app/main . +EXPOSE 3000 +CMD ["./main"] +``` + +``` +docker build --tag docker-gs-ping . +``` + + +