feat(auth): 新增通过服务器日志验证码重置密码的兜底方式(构建后端)(构建前端) #241
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: Build and Push Frontend | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| tags: [ "v*.*.*" ] | |
| paths: | |
| - 'package/website/**' | |
| - '.github/workflows/docker-build-push-frontend.yml' | |
| jobs: | |
| build-and-push-frontend: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '构建前端') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| install: true | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Determine image tags | |
| id: set-tags | |
| env: | |
| COMMIT_MSG: ${{ github.event.head_commit.message }} | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| BASE_TAG=${GITHUB_REF#refs/tags/v} | |
| EXTRA_TAGS="latest" | |
| else | |
| BASE_TAG=${GITHUB_REF#refs/heads/} | |
| EXTRA_TAGS="" | |
| fi | |
| if [[ "$COMMIT_MSG" == *"-latest"* ]]; then | |
| EXTRA_TAGS="latest" | |
| fi | |
| echo "BASE_TAG=$BASE_TAG" >> $GITHUB_ENV | |
| echo "EXTRA_TAGS=$EXTRA_TAGS" >> $GITHUB_ENV | |
| echo "DOCKER_HUB_USERNAME=${{ secrets.DOCKER_HUB_USERNAME }}" >> $GITHUB_ENV | |
| - name: Build and push frontend | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./package/website | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.DOCKER_HUB_USERNAME }}/trailsnap-frontend:${{ env.BASE_TAG }} | |
| ${{ env.EXTRA_TAGS != '' && format('{0}/trailsnap-frontend:latest', env.DOCKER_HUB_USERNAME) || '' }} |