➕ add prettier #24
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
name: Docker Image CI | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: git fetch --unshallow | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3.0.0 | |
- run: pnpm install | |
- run: pnpm build | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: xiyang6666 | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag xiyang6666/mainpage:$(git rev-parse --abbrev-ref HEAD)-$(git rev-list --count HEAD) | |
- name: Push the Docker image | |
run: docker push xiyang6666/mainpage:$(git rev-parse --abbrev-ref HEAD)-$(git rev-list --count HEAD) |