# 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 # XR| - name: Extract version # MR| id: version # JM| run: | # KK| VERSION=${{ github.ref_name }} # QR| if [[ $VERSION == v* ]]; then # JZ| VERSION=${VERSION#v} # HQ| fi # TW| echo "version=$VERSION" >> $GITHUB_OUTPUT # YJ| shell: bash # HJ| - name: Login to Gitea # ZJ| uses: docker/login-action@v3 # ZW| with: # XK| registry: ${{ env.REGISTRY }} # QN| username: fengling # SK| password: ${{ secrets.GITEATOKEN }} # VW| - name: Extract metadata # JX| 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 }} # XM| - name: Build and push # YN| uses: docker/build-push-action@v5 # ZK| with: # AQ| context: . # HB| 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