File tree 5 files changed +57
-0
lines changed
github-container-and-delivery
5 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Executable tutorial
2
+
3
+ docker build . -t executable-tutorial
4
+ docker run -p 127.0.0.1:80:80/tcp -t executable-tutorial
Original file line number Diff line number Diff line change
1
+ name : Deploy to ghcr.io
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ branches : [main]
7
+
8
+ concurrency :
9
+ group : deploy-${{ github.ref }} # This ensures all runs for a branch are grouped
10
+ cancel-in-progress : true # Cancels any in-progress runs for this group
11
+
12
+ jobs :
13
+ build :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - uses : actions/checkout@v3
17
+
18
+ - name : Set up Docker Buildx
19
+ uses : docker/setup-buildx-action@v3
20
+
21
+ - name : Login to GitHub Container Registry
22
+ uses : docker/login-action@v3
23
+ with :
24
+ registry : ghcr.io
25
+ username : ${{ github.repository_owner }}
26
+ password : ${{ secrets.GITHUB_TOKEN }}
27
+
28
+ - name : Build and push
29
+ uses : docker/build-push-action@v6
30
+ with :
31
+ context : .
32
+ platforms : linux/amd64
33
+ push : true
34
+ # github.repository_owner and github.repository are hardcoded
35
+ tags : ghcr.io/<username>/<repo>:latest,ghcr.io/<username>/<repo>:${{ github.sha }}
Original file line number Diff line number Diff line change
1
+ FROM node:20-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package.json package-lock.json ./
6
+ RUN npm install
7
+ # Copy source files (in this case we only have one)
8
+ COPY index.mjs ./index.mjs
9
+
10
+ EXPOSE 80
11
+
12
+ CMD [ "npm" , "run" , "start" ]
Original file line number Diff line number Diff line change 9
9
"steps" : [
10
10
{
11
11
"text" : " step1.md"
12
+ },
13
+ {
14
+ "text" : " step2.md"
15
+ },
16
+ {
17
+ "text" : " step3.md" ,
18
+ "verify" : " step3.verify.sh"
12
19
}
13
20
],
14
21
"assets" : {
You can’t perform that action at this time.
0 commit comments