name: Build docker and publish run-name: The pipeline for docker build on: push: branches: - main pull_request: branches: - main env: # Docker REPO: ${{ vars.REPO }} DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ vars.DOCKER_PASSWORD}} # Gitea GIT_USERNAME: ${{ vars.GIT_USERNAME }} GIT_PASSWORD: ${{ vars.GIT_PASSWORD }} # Host SSH SSH_HOST: ${{ vars.SSH_HOST }} SSH_PORT: ${{ vars.SSH_PORT }} SSH_USER: ${{ vars.SSH_USER }} SSH_PASSWORD: ${{ vars.SSH_PASSWORD }} # SMTP SMTP_SERVER_ADDRESS: ${{ vars.SMTP_SERVER_ADDRESS }} SMTP_USERNAME: ${{ vars.SMTP_USERNAME }} SMTP_PASSWORD: ${{ vars.SMTP_PASSWORD }} jobs: linux: runs-on: ubuntu-latest strategy: matrix: go: ["1.24.5"] steps: - name: Checkout uses: https://${{ env.GIT_USERNAME }}:${{ env.GIT_PASSWORD }}@${{ vars.DOMAIN_OF_GITEA}}/actions/checkout@v4 - name: Install Go environment uses: https://${{ env.GIT_USERNAME }}:${{ env.GIT_PASSWORD }}@${{ vars.DOMAIN_OF_GITEA}}/actions/setup-go@v4 with: go-version: ${{ matrix.go }} - name: Prepare GO environment run: | go env -w GOPROXY=https://goproxy.cn,direct go env -w GOPRIVATE="${{ vars.DOMAIN_OF_GITEA}}" git config --global url."https://${{ env.GIT_USERNAME }}:${{ env.GIT_PASSWORD }}@${{ vars.DOMAIN_OF_GITEA}}/".insteadOf "https://${{ vars.DOMAIN_OF_GITEA}}/" - name: Debug filesystem and build docker image run: | echo "=== Debug Information ===" echo "Current working directory: $(pwd)" echo "Gitea workspace: ${{ gitea.workspace }}" echo "Listing current directory:" ls -la echo "Checking if deploy directory exists:" ls -la deploy/ || echo "deploy directory not found" echo "Checking if .env file exists:" ls -la deploy/.env || echo ".env file not found in deploy/" echo "Trying to find .env files:" find . -name ".env" -type f 2>/dev/null || echo "No .env files found" echo "=========================" # Try to source the .env file with proper path if [ -f "./deploy/.env" ]; then echo "Found .env file, sourcing it..." source ./deploy/.env else echo "ERROR: .env file not found at ./deploy/.env" exit 1 fi go clean -modcache go mod tidy make build-linux make docker make publish-docker make docker-run