feat: handle players with disabled dms in chat processing #147
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" | |
| on: | |
| push: | |
| branches: [ main ] | |
| env: | |
| GO_VERSION: "1.24.4" | |
| jobs: | |
| # lint: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/setup-go@v4 | |
| # with: | |
| # go-version: "${{ env.GO_VERSION }}" | |
| # cache: false | |
| # - uses: actions/checkout@v4 | |
| # - name: go-lint | |
| # uses: golangci/golangci-lint-action@v3 | |
| # with: | |
| # version: latest | |
| # args: --timeout 5m0s | |
| # Detect services that need to be built via the builder | |
| detect-services: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| services: ${{ steps.detect-services.outputs.services }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: false | |
| - name: Create Go cache directories | |
| run: | | |
| mkdir -p ~/go/pkg/mod | |
| mkdir -p ~/.cache/go-build | |
| - name: Cache Go modules and build cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-detect-${{ hashFiles('**/go.sum', 'go.work.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-detect- | |
| ${{ runner.os }}-go- | |
| - name: detect-services | |
| id: detect-services | |
| env: | |
| GH_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| services=$(go run builder/main.go) | |
| echo "Raw services output: $services" | |
| echo "services=$services" >> $GITHUB_OUTPUT | |
| - name: print-services | |
| run: | | |
| echo "Services: ${{ steps.detect-services.outputs.services }}" | |
| docker-build-and-publish: | |
| needs: [ detect-services ] | |
| if: needs.detect-services.outputs.services != '[]' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| service: ${{ fromJson(needs.detect-services.outputs.services) }} | |
| steps: | |
| - name: Import Secrets | |
| uses: hollow-cube/actions/secrets@main | |
| with: | |
| token: ${{ secrets.VAULT_TOKEN }} | |
| path: global/github | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: false # Disable built-in cache, we'll handle it manually | |
| # Create cache directories before restoring | |
| - name: Create Go cache directories | |
| run: | | |
| mkdir -p ~/go/pkg/mod | |
| mkdir -p ~/.cache/go-build | |
| - name: Cache Go modules and build cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-${{ matrix.service }}-${{ hashFiles('**/go.sum', 'go.work.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ matrix.service }}- | |
| ${{ runner.os }}-go- | |
| - uses: ko-build/setup-ko@v0.8 | |
| env: | |
| KO_DOCKER_REPO: mworzala | |
| - name: Build image | |
| shell: bash | |
| run: | | |
| ko login docker.io --username mworzala --password ${{ env.DOCKER_PASS }} | |
| ko build ./services/${{ matrix.service }}/cmd/${{ matrix.service }} --base-import-paths --tags ${{ github.sha }} --platform linux/amd64 | |
| echo "Version: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | |
| helm-build: | |
| needs: [ detect-services, docker-build-and-publish ] | |
| if: needs.detect-services.outputs.services != '[]' # Only run if there are services to build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| service: ${{ fromJson(needs.detect-services.outputs.services) }} | |
| steps: | |
| - name: Helm build | |
| uses: hollow-cube/actions/helm-build@main | |
| with: | |
| vault-token: ${{ secrets.VAULT_TOKEN }} | |
| name: ${{ matrix.service }} | |
| path: "services/${{ matrix.service }}/deploy/helm-chart" | |
| helm-deploy: | |
| needs: [ detect-services, docker-build-and-publish, helm-build ] | |
| if: needs.detect-services.outputs.services != '[]' # Only run if there are services to build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| service: ${{ fromJson(needs.detect-services.outputs.services) }} | |
| steps: | |
| - name: Helm deploy | |
| uses: hollow-cube/actions/helm-deploy@main | |
| with: | |
| vault-token: ${{ secrets.VAULT_TOKEN }} | |
| name: ${{ matrix.service }} | |
| cluster: prod-v2 | |
| values: "services/${{ matrix.service }}/deploy/helm-chart/values-prod.yaml" |