fixed colors #21
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: Next.js | |
| on: # specify the build to trigger the automated ci/cd | |
| push: | |
| branches: | |
| - "main" | |
| jobs: | |
| build: | |
| name: Build Docker image | |
| runs-on: ubuntu-latest # specify the build machine | |
| steps: | |
| - # checkout to the repository on the build machine | |
| name: Checkout | |
| uses: actions/checkout@v3 | |
| - # login to Docker Hub using the secrets provided | |
| name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - # create a buildkit builder instance | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - # build the container image and push it to Docker Hub | |
| name: Build and push | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/nextjs-app | |
| - # Login to the server | |
| name: Restart K3S deployment | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| port: ${{ secrets.SSH_PORT }} | |
| key: ${{ secrets.SSH_KEY }} | |
| # rollout your deployment | |
| script: kubectl rollout restart deployment nextjs-app-deployment |