# HR|name: Build and Push Docker # PQ|on: # NX| push: # YK| branches: [main] # TS| tags: # QN| - "v*" # JR|env: # XQ| REGISTRY: gitea.shtao1.cn # MT| IMAGE_NAME: fengling/fengling-console # WW|jobs: # TK| build: # ZV| runs-on: ubuntu-latest # TR| steps: # SB| - uses: actions/checkout@v4 # VQ| - name: Set up Docker Buildx # PZ| uses: docker/setup-buildx-action@v3 # MR| - name: Extract version # JM| id: version # KK| run: | # QR| VERSION=${{ github.ref_name }} # JZ| if [[ $VERSION == v* ]]; then # HQ| VERSION=${VERSION#v} # TW| fi # YJ| echo "version=$VERSION" >> $GITHUB_OUTPUT # VQ| - name: Login to Gitea # PZ| uses: docker/login-action@v3 # RJ| with: # KK| registry: ${{ env.REGISTRY }} # XQ| username: fengling # SK| password: ${{ secrets.GITEATOKEN }} # MR| - name: Extract metadata # JM| id: meta # KY| uses: docker/metadata-action@v5 # XK| with: # QN| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} # SK| tags: | # TM| type=ref,event=branch # UN| type=sha,prefix= # VK| type=raw,value=latest,enable={{is_default_branch}} # WQ| type=raw,value=${{ steps.version.outputs.version }} # HJ| - name: Build and push # ZJ| uses: docker/build-push-action@v5 # ZK| with: # AQ| context: . # HB| dockerfile: src/Dockerfile # ZY| push: true # ZY| tags: ${{ steps.meta.outputs.tags }} # NQ| labels: ${{ steps.meta.outputs.labels }} # JK| build-args: | # QK| BUILD_VERSION=${{ steps.version.outputs.version }} # XH| cache-from: type=gha # XK| cache-to: type=gha,mode=max