File tree Expand file tree Collapse file tree 4 files changed +80
-0
lines changed
Expand file tree Collapse file tree 4 files changed +80
-0
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 1+ FROM haskell:8.10 AS build
2+ RUN mkdir -p /app/user
3+ WORKDIR /app/user
4+ COPY stack.yaml *.cabal ./
5+
6+ RUN export PATH=$(stack path --local-bin):$PATH
7+ RUN stack build --dependencies-only
8+
9+ COPY . /app/user
10+ RUN stack install
11+
12+ FROM ubuntu:latest AS exec
13+ ENV LANG C.UTF-8
14+ CMD /root/.local/bin/mat-chalmers
15+ EXPOSE 5007
Original file line number Diff line number Diff line change 1+ version : ' 3.7'
2+
3+ services :
4+ mat :
5+ build : .
6+ restart : unless-stopped
7+ ports :
8+ - " 5007:5007"
You can’t perform that action at this time.
0 commit comments