Merge pull request #19 from f-code-club/feature/case-insensitive-stri… #19
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
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io/${{ github.repository }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up docker buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Login to docker hub | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor}} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx- | |
| - name: Build image | |
| run: docker compose -f compose.build.yaml build | |
| - name: Push image | |
| run: docker compose -f compose.build.yaml push | |
| deploy: | |
| runs-on: self-hosted | |
| needs: [build] | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io/${{ github.repository }} | |
| BOT_PREFIX: ${{ secrets.BOT_PREFIX }} | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| CANDIDATE_ROLE: ${{ secrets.CANDIDATE_ROLE }} | |
| MODERATOR_ROLE: ${{ secrets.MODERATOR_ROLE }} | |
| steps: | |
| - name: Checkout Develop | |
| uses: actions/checkout@v3 | |
| - name: Login to docker hub | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor}} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Clean container and image | |
| run: docker compose -f compose.yaml -p fcode-discord-bot down --rmi all -v | |
| - name: Deploy | |
| run: docker compose -f compose.yaml -p fcode-discord-bot up -d |