chore: upgrade go version from 1.25.3 to 1.25.5 #385
Workflow file for this run
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: Deploy Discord Bot | |
| on: | |
| push: | |
| paths: | |
| - apps/discord-bot/** | |
| - command/** | |
| - config/** | |
| - db/** | |
| - helper/** | |
| - model/** | |
| - platform/** | |
| - service/** | |
| - "go.mod" | |
| - "go.sum" | |
| branches: | |
| - main | |
| pull_request: {} | |
| permissions: | |
| actions: write | |
| contents: read | |
| env: | |
| REGISTRY: registry.fly.io | |
| MAIN_APP_NAME: senchabot0728dc | |
| jobs: | |
| build: | |
| name: Build | |
| # only build/deploy main branch on pushes | |
| if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.11.0 | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| # Setup cache | |
| - name: Cache Docker layers | |
| uses: actions/cache@v3 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx- | |
| - name: Fly Registry Auth | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: x | |
| password: ${{ secrets.DISCORD_BOT_FLY_API }} | |
| - name: Docker build | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| file: ./apps/discord-bot/Dockerfile | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.MAIN_APP_NAME }}:${{ github.ref_name }}-${{ github.sha }} | |
| build-args: | | |
| COMMIT_SHA=${{ github.sha }} | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | |
| # This ugly bit is necessary if you don't want your cache to grow forever | |
| # till it hits GitHub's limit of 5GB. | |
| # Temp fix | |
| # https://github.com/docker/build-push-action/issues/252 | |
| # https://github.com/moby/buildkit/issues/1896 | |
| - name: Move cache | |
| run: | | |
| rm -rf /tmp/.buildx-cache | |
| mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| # only build/deploy main branch on pushes | |
| if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.11.0 | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Deploy main | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| uses: superfly/flyctl-actions@1.3 | |
| with: | |
| args: "deploy --app ${{ env.MAIN_APP_NAME }} --image ${{ env.REGISTRY }}/${{ env.MAIN_APP_NAME }}:${{ github.ref_name }}-${{ github.sha }} --config ./apps/discord-bot/fly.toml" | |
| env: | |
| FLY_API_TOKEN: ${{ secrets.DISCORD_BOT_FLY_API }} | |
| # - name: Deploy Production | |
| # if: ${{ github.ref == 'refs/heads/main' }} | |
| # uses: superfly/flyctl-actions@1.3 | |
| # with: | |
| # args: "deploy --image ${{ env.REGISTRY }}/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }}" | |
| # env: | |
| # FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |