-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
118 additions
and
9 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,62 @@ | ||
on: | ||
push: | ||
branches: | ||
- vue-press | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
COMMENT_SECRET: ${{ secrets.COMMENT_SECRET }} | ||
COMMENT_APPID: ${{ secrets.COMMENT_APPID }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Build | ||
run: | | ||
yarn | ||
yarn build | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
driver: docker | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
flavor: | | ||
latest=true | ||
tags: | | ||
type=schedule | ||
type=ref,event=tag | ||
type=sha,prefix=,format=long,enable=true,priority=100 | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -11,20 +11,23 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install | ||
run: npm i | ||
|
||
- name: Build | ||
run: npm run build | ||
- name: Install And Build | ||
run: | | ||
yarn | ||
yarn build | ||
- name: Add Domain | ||
run: cd public && echo 'blog.abplan.top' > CNAME | ||
|
||
- name: Install SSH Client | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.DEPLOY_KEY }} | ||
# - name: Install SSH Client | ||
# uses: webfactory/[email protected] | ||
# with: | ||
# ssh-private-key: ${{ secrets.DEPLOY_KEY }} | ||
|
||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
|
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,10 @@ | ||
FROM nginx:stable-alpine | ||
|
||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
COPY conf/nginx.conf /etc/nginx/nginx.conf | ||
COPY ./public /app | ||
|
||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
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,34 @@ | ||
user nginx; | ||
|
||
worker_processes 1; | ||
pid /var/run/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer"' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
server { | ||
listen 80; | ||
server_name _ default_server; | ||
access_log /var/log/nginx/access.log main; | ||
error_log /var/log/nginx/error.log error; | ||
# Hide nginx version information. | ||
server_tokens off; | ||
|
||
location / { | ||
root /app; | ||
index index.html; | ||
add_header Cache-Control "no-store"; | ||
try_files $uri $uri/index.html /index.html; | ||
# proxy_set_header Host $host; | ||
} | ||
} | ||
} |
163b8b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
blog – ./
blog-ochre-chi.vercel.app
blog.abplan.top
blog-12ain.vercel.app
blog-git-vue-press-12ain.vercel.app