Skip to content

Commit bb91ca4

Browse files
authored
Merge pull request #20 from metacpan/oalders/gh-actions
Add Docker build and push workflows
2 parents e3b272f + a4dffcb commit bb91ca4

File tree

8 files changed

+73
-26
lines changed

8 files changed

+73
-26
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Build deployment container
3+
on:
4+
push:
5+
branches:
6+
- prod
7+
- staging
8+
workflow_dispatch:
9+
jobs:
10+
docker:
11+
runs-on: ubuntu-22.04
12+
name: Docker Push
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Docker build
16+
run: docker build . -t metacpan/metacpan-explorer:$GITHUB_SHA
17+
- name: Log in to Docker Hub
18+
uses: docker/login-action@v2
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USER }}
21+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
22+
- name: Push build to Docker hub
23+
run: docker push metacpan/metacpan-explorer:$GITHUB_SHA
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Build production container
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-22.04
11+
name: Docker Push
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: docker build
15+
run: docker build . -t metacpan/metacpan-explorer:latest
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v2
18+
with:
19+
username: ${{ secrets.DOCKER_HUB_USER }}
20+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
21+
- name: Push build to Docker Hub
22+
run: docker push metacpan/metacpan-explorer:latest

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "inc/bootstrap"]
22
path = app/inc/bootstrap
3-
url = https://github.com/twitter/bootstrap.git
3+
url = https://github.com/twbs/bootstrap.git

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ WORKDIR /usr/src/app
77
# Bundle app source
88
COPY . .
99

10-
RUN npm install
10+
RUN npm install --verbose
1111

1212
CMD [ "npm", "start" ]

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
metacpan-explorer
2-
=================
1+
# metacpan-explorer
32

4-
## Updating Submodules
3+
## Clone
54

65
This repo includes Bootstrap as a submodule,
76
so after cloning (or pulling) make sure your submodule is up to date:
87

9-
git submodule init && git submodule update
8+
```
9+
git clone https://github.com/metacpan/metacpan-explorer.git
10+
git submodule init && git submodule update
11+
```
1012

1113
## Docker Development
1214

1315
###Build an image:
1416

15-
`docker build -t metacpan/explorer-web-app .`
17+
`docker build -t metacpan/metacpan-explorer .`
1618

1719
###Run your image:
1820

19-
`docker run -p 8080:8080 -d metacpan/explorer-web-app`
21+
`docker run -p 8080:8080 metacpan/metacpan-explorer`
2022

2123
###View in your browser:
2224

bin/docker-build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
docker build -t metacpan/metacpan-explorer:latest .

bin/docker-run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
docker run --rm -it -v "$PWD:/usr/src/app" -p 8080:8080 metacpan/metacpan-explorer:latest

package-lock.json

Lines changed: 8 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)