Deploy #94
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: Deploy | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: swiftfiddle/swiftfiddle-lsp:latest | |
- uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
docker pull swiftfiddle/swiftfiddle-lsp:latest | |
docker rename swiftfiddle-lsp swiftfiddle-lsp_ | |
docker stop swiftfiddle-lsp_ | |
docker run -d --rm -p 80:8080 --name swiftfiddle-lsp swiftfiddle/swiftfiddle-lsp | |
docker image prune -f |