get rid of BOT_STATUS #151
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 Kernel Docker Image | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-push: | |
| runs-on: self-hosted | |
| if: github.actor == 'ptrlrd' && github.repository_owner == 'ptrlrd' | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v2 | |
| - name: Configure Git | |
| run: | | |
| export HOME=$(pwd) | |
| git config --global --add safe.directory /home/runner/actions-runner/_work/kernel/kernel | |
| git config --global user.name '${{ secrets.GIT_USER_NAME }}' | |
| git config --global user.email '${{ secrets.GIT_USER_EMAIL }}' | |
| BRANCH_NAME="${GITHUB_REF#refs/heads/}" || "main" | |
| git checkout $BRANCH_NAME | |
| # - name: Commit banned_users.json | |
| # run: | | |
| # if git status --porcelain | grep 'data/banned_users.json'; then | |
| # git add data/banned_users.json | |
| # git commit -m "Automatically update banned_users.json" | |
| # git remote set-url origin https://x-access-token:${{ secrets.GIT_TOKEN }}@github.com/${{ secrets.GIT_USER_NAME }}/kernel.git | |
| # git push --set-upstream origin $BRANCH_NAME | |
| # else | |
| # echo "No changes in banned_users.json" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and Push Docker Image | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| push: true | |
| tags: ptrlrd/kernel:latest | |
| - name: Clean up old images | |
| run: docker image prune -a -f |