Skip to content

Commit 76ff989

Browse files
authored
DockerfileとCDワークフローを修正 (#33)
* Update Dockerfile * Update workflows * Update workflows * Update README.md * Update README.md * Update workflows
1 parent 1c682a2 commit 76ff989

8 files changed

Lines changed: 55 additions & 174 deletions

File tree

.github/workflows/cd.yaml

Lines changed: 0 additions & 133 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
inputs:
8+
environment_name:
9+
description: Environment
10+
required: true
11+
type: choice
12+
options:
13+
- dev
14+
- stg
15+
- qa
16+
- prod
17+
jobs:
18+
deploy:
19+
uses: fun-dotto/way/.github/workflows/backend-deploy.yml@main
20+
permissions:
21+
contents: read
22+
id-token: write
23+
with:
24+
environment_name: ${{ github.event.inputs.environment_name }}
25+
secrets: inherit

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
types:
10+
- opened
11+
- ready_for_review
12+
- reopened
13+
- synchronize
14+
workflow_dispatch:
15+
jobs:
16+
test:
17+
uses: fun-dotto/way/.github/workflows/backend-test.yml@main
18+
permissions:
19+
contents: read
20+
secrets: inherit

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM golang:1.25.4-alpine AS builder
2+
FROM golang:1.25.6-alpine AS builder
33

44
# Install build dependencies
55
RUN apk add --no-cache git
@@ -13,27 +13,23 @@ COPY go.mod go.sum ./
1313
# Download dependencies
1414
RUN go mod download
1515

16-
# Install Task
17-
RUN go install github.com/go-task/task/v3/cmd/task@latest
18-
1916
# Copy source code
2017
COPY . .
2118

22-
# Generate code from OpenAPI spec
23-
RUN task generate
24-
2519
# Build the application
2620
RUN CGO_ENABLED=0 GOOS=linux go build -tags timetzdata -o ./bin/main ./cmd/server/main.go
2721

2822
# Runtime stage
29-
FROM alpine:3.22.2
23+
FROM alpine:3
24+
25+
ENV PORT=8080
3026

3127
# Install runtime dependencies
3228
RUN apk add --no-cache ca-certificates
3329

3430
# Create non-root user
3531
RUN addgroup -g 1000 appuser && \
36-
adduser -D -u 1000 -G appuser appuser
32+
adduser -D -u 1000 -G appuser appuser
3733

3834
# Set working directory
3935
WORKDIR /app
@@ -51,7 +47,7 @@ RUN chown -R appuser:appuser /app
5147
USER appuser
5248

5349
# Expose port
54-
EXPOSE 8080
50+
EXPOSE $PORT
5551

5652
# Run the application
5753
CMD ["/app/main"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Dotto Announcement API
22

3-
[![CI](https://github.com/fun-dotto/announcement-api/actions/workflows/ci.yaml/badge.svg)](https://github.com/fun-dotto/announcement-api/actions/workflows/ci.yaml)
3+
[![CI](https://github.com/fun-dotto/announcement-api/actions/workflows/test.yml/badge.svg)](https://github.com/fun-dotto/announcement-api/actions/workflows/test.yml)
44

5-
© 2025 Dotto
5+
© 2026 Dotto

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/fun-dotto/announcement-api
22

3-
go 1.25.4
3+
go 1.25.6
44

55
tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen
66

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[tools]
22
"aqua:go-task/task" = "latest"
3-
go = "1.25.4"
3+
go = "1.25.6"

0 commit comments

Comments
 (0)