Skip to content

Commit

Permalink
feat: add Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 12, 2022
1 parent 1bbb395 commit 4959338
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
40 changes: 39 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ jobs:
body: |
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/awesome-mac@${{steps.create_tag.outputs.versionNumber}}/file/README.md)
${{ steps.changelog.outputs.compareurl }}
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/awesome-mac/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
```bash
Expand All @@ -58,5 +60,41 @@ jobs:
# dist/awesome-mac.zh.json
```
## Docker
```bash
docker pull wcjiang/awesome-mac:${{steps.changelog.outputs.version}}
```
```bash
docker run --name awesome-mac --rm -d -p 9881:80 wcjiang/awesome-mac:${{steps.changelog.outputs.version}}
# Or
docker run --name awesome-mac -itd -p 9881:80 wcjiang/awesome-mac:${{steps.changelog.outputs.version}}
```
Visit the following URL in your browser
```bash
http://localhost:9881/
```
- run: npm install @jsdevtools/npm-publish -g
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json

# Create Docker Image
- name: Docker login
if: steps.create_tag.outputs.successful
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Build Awesome Mac image
if: steps.create_tag.outputs.successful
run: docker image build -t tools .

- name: Tags & Push image
if: steps.create_tag.outputs.successful
run: |
echo "outputs.tag - ${{ steps.changelog.outputs.version }}"
docker tag tools ${{ secrets.DOCKER_USER }}/tools:${{steps.changelog.outputs.version}}
docker tag tools ${{ secrets.DOCKER_USER }}/tools:latest
docker push ${{ secrets.DOCKER_USER }}/tools:${{steps.changelog.outputs.version}}
docker push ${{ secrets.DOCKER_USER }}/tools:latest
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM nginx:1-alpine

ENV APPDIR /usr/share/nginx/html
RUN mkdir -p $APPDIR

RUN cat /etc/nginx/conf.d/default.conf

WORKDIR $APPDIR

ADD ./dist /usr/share/nginx/html

0 comments on commit 4959338

Please sign in to comment.