Delete data directory #21
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: 自动构建Docker镜像 | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 配置 Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: 登录 Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: 生成镜像标签 | |
| id: tags | |
| run: | | |
| TIMESTAMP=$(date +'%Y%m%d-%H%M%S') | |
| COMMIT_SHA_SHORT=$(echo $GITHUB_SHA | cut -c1-7) | |
| echo "tags=qianye60/htmlproxy:latest,qianye60/htmlproxy:$TIMESTAMP,qianye60/htmlproxy:$COMMIT_SHA_SHORT" >> $GITHUB_OUTPUT | |
| - name: 构建并推送Docker镜像 | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| target: nginx | |
| push: true | |
| tags: ${{ steps.tags.outputs.tags }} | |
| platforms: linux/amd64 | |
| cache-from: type=registry,ref=qianye60/htmlproxy:buildcache | |
| cache-to: type=registry,ref=qianye60/htmlproxy:buildcache,mode=max,ignore-error=true |