Skip to content

Commit

Permalink
ci: ✨ update node version
Browse files Browse the repository at this point in the history
  • Loading branch information
12ain committed Jun 3, 2024
1 parent a3da750 commit e3bb1d9
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 85 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- vue-press
permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Install Node.js 🔧
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4 🔺
name: Install pnpm
with:
version: 8
run_install: false

- name: Install And Build 🛎️
run: |
pnpm install && pnpm 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: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: main
folder: public
clean: true
99 changes: 53 additions & 46 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,69 @@
on:
push:
branches:
- vue-press
- 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 }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false

- name: Build
run: |
pnpm install && pnpm 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 }}
38 changes: 0 additions & 38 deletions .github/workflows/deploy.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"scripts": {
"dev": "vuepress dev src",
"build": "vuepress build src",
"build": "vuepress build src && mv -f src/.vuepress/dist ./public",
"deploy": "./scripts/deploy"
},
"devDependencies": {
Expand Down
Empty file added src/series/.gitkeep
Empty file.

1 comment on commit e3bb1d9

@vercel
Copy link

@vercel vercel bot commented on e3bb1d9 Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.