FIX : Github Workflow #6
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: Docker Image CI | |
| on: | |
| push: | |
| branches: [ "edge" ] | |
| jobs: | |
| build-and-run: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: staticaron | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build the Docker image | |
| run: docker build -t staticaron/yui-bot:latest . | |
| - name: Push the Image | |
| run: docker push staticaron/yui-bot:latest | |
| - name: Set up SSH private key | |
| uses: webfactory/ssh-agent@v0.5.3 | |
| with: | |
| ssh-private-key: ${{ secrets.VPS_PRIVATE_KEY }} | |
| - name: Log into the VPS | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.VPS_HOST }} | |
| username: ${{ secrets.VPS_USERNAME }} | |
| key: ${{ secrets.VPS_PRIVATE_KEY }} | |
| port: 22 | |
| script: | | |
| docker pull docker.io/staticaron/yui-bot:latest | |
| docker stop yui-bot || true | |
| docker rm yui-bot || true | |
| docker run --rm -d --name yui-bot docker.io/staticaron/yui-bot:latest |