File tree Expand file tree Collapse file tree 3 files changed +59
-2
lines changed
Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Docker Image
2+
3+ on :
4+ release :
5+ types : [ published ]
6+
7+ env :
8+ # GitHub repository is basically "$org/$repo"
9+ IMAGE_NAME : ${{ github.repository }}
10+
11+ jobs :
12+ build-and-push-image :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+ packages : write
17+
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v2
21+
22+ # User triggering the action is authenticated to the container registry
23+ - name : Log in to the Container registry
24+ uses : docker/login-action@v1.10.0
25+ with :
26+ registry : ghcr.io
27+ username : ${{ github.actor }}
28+ password : ${{ secrets.GITHUB_TOKEN }}
29+
30+ # Basically sets the image tag from the release
31+ - name : Extract metadata for Docker
32+ id : meta
33+ uses : docker/metadata-action@v3.6.0
34+ with :
35+ images : ghcr.io/${{ env.IMAGE_NAME }}
36+
37+ - name : Build and push Docker image
38+ uses : docker/build-push-action@v2.7.0
39+ with :
40+ context : .
41+ push : true
42+ tags : ${{ steps.meta.outputs.tags }}
43+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1+ name : Build Docker image.
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout code
12+ uses : actions/checkout@v2
13+ - name : Build the Docker image
14+ run : docker build . --file Dockerfile
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ RUN npm run lint && npm run build
1010
1111RUN npm install -g http-server
1212
13- ENV PORT 8000
13+ ENV PORT 8080
1414EXPOSE $PORT
1515
16- CMD http-server dist -p "$PORT" -d false -i false
16+ CMD http-server dist -p "$PORT" -d false
You can’t perform that action at this time.
0 commit comments