Repository navigation
This file contains hidden or 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: Deploy VitePress site to Docker | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| concurrency: | |
| group: deploy-docker-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| language: [zh, en, ja, zh-hk, zh-tw] | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=64000" | |
| CURRENT_LANGUAGE: ${{ matrix.language }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.11.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build with VitePress for ${{ matrix.language }} | |
| run: pnpm build | |
| - name: Get Date | |
| id: date | |
| run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
| - name: Push Image | |
| env: | |
| DOCKER_USERNAME: ${{ secrets.ALIYUN_USERNAME }} | |
| DOCKER_PASSWORD: ${{ secrets.ALIYUN_PASSWORD }} | |
| DOCKER_REGISTRY: ${{ secrets.ALIYUN_REGISTRY }} | |
| SHA: ${{ github.sha }} | |
| DATE: ${{ steps.date.outputs.date }} | |
| run: | | |
| docker build . -t doc-v3:${{ matrix.language }}-latest | |
| docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY | |
| docker tag doc-v3:${{ matrix.language }}-latest $DOCKER_REGISTRY/mineadmins/docs:${{ matrix.language }}-$DATE | |
| docker push $DOCKER_REGISTRY/mineadmins/docs:${{ matrix.language }}-$DATE |