Skip to content

Commit ca33ae8

Browse files
committed
docker build
1 parent 276f23a commit ca33ae8

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/docker.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main"]
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
attestations: write
15+
id-token: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Login to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.repository_owner }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Docker meta
28+
id: meta
29+
uses: docker/metadata-action@v5
30+
31+
- name: Build and push docker image
32+
uses: docker/build-push-action@v6
33+
with:
34+
context: "."
35+
file: "Dockerfile"
36+
push: true
37+
tags: ghcr.io/modfest/website:latest
38+
labels: ${{ steps.meta.outputs.labels }}
39+
build-args: |
40+
GIT_REVISION=${{ github.head_ref }}.${{ github.sha }}

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM denoland/deno:alpine
2+
3+
ARG GIT_REVISION
4+
ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}
5+
6+
WORKDIR /app
7+
8+
COPY . .
9+
RUN deno cache main.ts
10+
11+
EXPOSE 8000
12+
13+
CMD ["run", "-A", "main.ts"]

0 commit comments

Comments
 (0)