File tree Expand file tree Collapse file tree 4 files changed +86
-0
lines changed Expand file tree Collapse file tree 4 files changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+ on :
3+ push :
4+ branches : [ master ]
5+ pull_request :
6+ branches : [ master ]
7+
8+ workflow_dispatch :
9+
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+
16+ - uses : actions/checkout@v2
17+
18+ - name : ls
19+ run : ls -alh $GITHUB_WORKSPACE
20+
21+ - name : update apt
22+ run : sudo apt-get update
23+
24+ - name : install basic tools
25+ run : sudo apt-get install -y git curl docker.io containerd runc
26+
27+ - name : Creates a Docker image of the template node
28+ run : docker build . -t helloworld:1.0
29+
30+ - name : List images
31+ run : docker image ls
32+
33+ - name : Login to GHCR
34+ uses : docker/login-action@v2
35+ with :
36+ registry : ghcr.io
37+ username : ${{ github.actor }}
38+ password : ${{ secrets.GITHUB_TOKEN }}
39+
40+ - name : Publishes the image to GHCR
41+ run : |
42+ DOCKER_IMAGE_ID=$( docker image ls | grep helloworld | awk '{ print $3 }' )
43+ docker tag $DOCKER_IMAGE_ID "ghcr.io/phpengine/helloworld:latest"
44+ docker push ghcr.io/phpengine/helloworld:latest
45+
46+
Original file line number Diff line number Diff line change 1+ FROM ubuntu:20.04
2+
3+ WORKDIR /app
4+
5+ RUN echo "install apache"
6+ RUN apt-get update
7+ RUN apt-get install -y apache2 curl
8+
9+ RUN echo "copy in index html"
10+ COPY index.html /var/www/html/
11+
12+ CMD [ "apachectl" , "-D" , "FOREGROUND" ]
13+
Original file line number Diff line number Diff line change 1+
2+
3+ ## Docker Build
4+
5+ ```
6+ docker build . -f Dockerfile -t helloworld:1.0
7+ docker run -p 127.0.0.1:8333:3000 helloworld:1.0
8+ docker exec -it $(docker ps -a | grep helloworld | awk '{ print $1 }' ) /bin/bash
9+ docker tag $(docker image ls | grep helloworld | head -n1 | awk '{ print $3 }' ) fantasticfables/fables-wp:latest
10+ docker push t3rnhub/fables-wp:latest
11+
12+ build, tag, push in one line
13+
14+ docker build . -f Dockerfile -t helloworld:1.0 --no-cache && \
15+ docker tag $(docker image ls | grep helloworld | head -n1 | awk '{ print $3 }' ) fantasticfables/fables-wp:latest && \
16+ docker push t3rnhub/helloworld:latest
17+
18+ ```
Original file line number Diff line number Diff line change 1+ < html >
2+ < head >
3+ < title > Hello World</ title >
4+ </ head >
5+ < body >
6+ < h1 > Hello World</ h1 >
7+ < p > To the World, Hello</ p >
8+ </ body >
9+ </ html >
You can’t perform that action at this time.
0 commit comments