updated the hpa and docker code #23
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: CI dev | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'judge-image-for-worker/**' | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PERSONAL_ACCESS_TOKEN }} | |
| - name: set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./judge-image-for-worker/workers | |
| file: ./judge-image-for-worker/workers/Dockerfile | |
| push: true | |
| tags: lightningsagar/worker:${{ github.sha }} | |
| - name: Clone staging ops/repo and Documentation | |
| env: | |
| GITHUB_PAT: ${{ secrets.PAT }} | |
| run: | | |
| git clone https://github.com/lightning-sagar/Judge.git | |
| cd Judge | |
| sed -i "s|image: lightningsagar/worker:.*|image: lightningsagar/worker:${{ github.sha }}|" worker-ops/judge-workers.yml | |
| sed -i "s|lightningsagar/worker:.*|lightningsagar/worker:${{ github.sha }}|" docs/src/app/selfhost/page.tsx | |
| git config --global user.name "GitHub Actions Bot" | |
| git config --global user.email "action@github.com" | |
| git add . | |
| git commit -m "Updated the image tag" | |
| git push https://${GITHUB_PAT}@github.com/lightning-sagar/Judge.git main | |
| echo "Completed and updated the Docs." | |