Skip to content

Commit dd84a87

Browse files
committed
docker action test
1 parent e1d7955 commit dd84a87

File tree

2 files changed

+76
-16
lines changed

2 files changed

+76
-16
lines changed

.github/workflows/release.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*'
7+
8+
jobs:
9+
release:
10+
name: Publish Release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Publish Release
18+
uses: leomotors/auto-publish-release@main
19+
with:
20+
githubToken: ${{ secrets.GITHUB_TOKEN }}
21+
title: 'programming.in.th'
22+
tag: ${{ github.ref_name }}
23+
24+
image:
25+
name: Docker Image
26+
runs-on: ubuntu-latest
27+
28+
permissions:
29+
id-token: write
30+
packages: write
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
- name: Log in to GitHub Container Registry
39+
uses: docker/login-action@v3
40+
with:
41+
registry: ghcr.io
42+
username: ${{ github.repository_owner }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- uses: winterjung/split@v2
46+
id: version
47+
with:
48+
msg: ${{ github.ref_name }}
49+
separator: '.'
50+
51+
- name: Build Docker image
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: .
55+
file: Dockerfile
56+
push: true
57+
tags: ghcr.io/programming-in-th/programming.in.th:${{ github.ref_name }},ghcr.io/programming-in-th/programming.in.th:v${{ steps.version.outputs._0 }},ghcr.io/programming-in-th/programming.in.th:latest
58+
platforms: linux/amd64,linux/arm64
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max

Dockerfile

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
FROM node:20-alpine AS base
66

7-
ENV DOCKER_BUILD=1
8-
ENV NEXT_PUBLIC_REALTIME_URL=https://rtss.crackncode.org
9-
ENV NEXT_PUBLIC_AWS_URL=https://prginth01.sgp1.cdn.digitaloceanspaces.com
7+
ENV DOCKER_BUILD 1
8+
ENV NEXT_PUBLIC_REALTIME_URL https://rtss.crackncode.org
9+
ENV NEXT_PUBLIC_AWS_URL https://prginth01.sgp1.cdn.digitaloceanspaces.com
1010

11-
ENV GITHUB_ID=mockvalue
12-
ENV GITHUB_SECRET=mockvalue
13-
ENV GOOGLE_CLIENT_ID=mockvalue
14-
ENV GOOGLE_CLIENT_SECRET=mockvalue
11+
ENV GITHUB_ID mockvalue
12+
ENV GITHUB_SECRET mockvalue
13+
ENV GOOGLE_CLIENT_ID mockvalue
14+
ENV GOOGLE_CLIENT_SECRET mockvalue
1515

16-
ENV BUCKET_NAME=mockvalue
17-
ENV BUCKET_KEY_ID=mockvalue
18-
ENV BUCKET_KEY_SECRET=mockvalue
19-
ENV BUCKET_ENDPOINT=mockvalue
20-
ENV BUCKET_REGION=mockvalue
16+
ENV BUCKET_NAME mockvalue
17+
ENV BUCKET_KEY_ID mockvalue
18+
ENV BUCKET_KEY_SECRET mockvalue
19+
ENV BUCKET_ENDPOINT mockvalue
20+
ENV BUCKET_REGION mockvalue
2121

2222
# ? -------------------------
2323
# ? Builder: Build production Next.js application to .next
@@ -53,10 +53,10 @@ FROM base AS runner
5353

5454
WORKDIR /app
5555

56-
LABEL name="programming.in.th"
56+
LABEL name "programming.in.th"
5757

5858
USER node
59-
ENV NODE_ENV=production
59+
ENV NODE_ENV production
6060

6161
COPY package.json ./
6262

@@ -66,8 +66,8 @@ COPY --chown=node:node --from=builder /app/.next/standalone ./
6666
COPY --chown=node:node --from=builder /app/.next/static ./.next/static
6767
COPY --chown=node:node --from=builder /app/public ./public
6868

69-
ENV PORT=3000
70-
ENV HOST=0.0.0.0
69+
ENV PORT 3000
70+
ENV HOST 0.0.0.0
7171

7272
EXPOSE 3000
7373
CMD ["node", "server.js"]

0 commit comments

Comments
 (0)