Skip to content

Commit

Permalink
Merge pull request #80 from yukirii/feature/dockernize-build-tool
Browse files Browse the repository at this point in the history
dockernize build tool
  • Loading branch information
kiki-kekat authored Oct 28, 2020
2 parents 5b4f2ec + 51da3b7 commit a7a93f0
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release-build-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release-build-tools

on:
release:
types:
- published

env:
DOCKER_BASE_NAME: ghcr.io/${{ github.repository }}-build-tools

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build docker image
run: |
docker build . \
-t "${DOCKER_BASE_NAME}:${GITHUB_SHA::8}" \
-t "${DOCKER_BASE_NAME}:${{ github.event.release.tag_name }}" \
-t "${DOCKER_BASE_NAME}:latest"
- run: docker images

- name: Push docker image
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push "${DOCKER_BASE_NAME}:${GITHUB_SHA::8}"
docker push "${DOCKER_BASE_NAME}:${{ github.event.release.tag_name }}"
docker push "${DOCKER_BASE_NAME}:latest"
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:14.14-slim

RUN apt update \
&& apt install -y git ssh tar gzip ca-certificates

RUN mkdir /blog
WORKDIR /blog

ADD entrypoint.sh /
ADD package*.json /blog/
ADD gulpfile.js /blog/

RUN npm install

ENTRYPOINT ["/entrypoint.sh"]
CMD ["npm", "start"]
16 changes: 16 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'
services:
blog:
image: ghcr.io/jpaztech/blog-build-tools:latest
working_dir: /blog
command: ["npm", "start"]
ports:
- "4000:4000"
volumes:
- "./articles:/blog/articles"
- "./scaffolds:/blog/scaffolds"
- "./source:/blog/source"
- "./themes:/blog/themes"
- "./_config.yml:/blog/_config.yml"
- "./github-issue-template.md:/blog/github-issue-template.md"
- "./.textlintrc:/blog/.textlintrc"
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

umask 0000

exec "$@"

0 comments on commit a7a93f0

Please sign in to comment.