-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from yukirii/feature/dockernize-build-tool
dockernize build tool
- Loading branch information
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
umask 0000 | ||
|
||
exec "$@" |