Merge pull request #8 from minisbett/master #47
This file contains 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: Deployment | |
on: | |
push: | |
branches: [ "release" ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
working-directory: . | |
run: docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/huisbot:latest | |
- name: Log into Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push the image to Docker Hub | |
run: docker push minisbett/huisbot | |
- name: Deploy the image on production server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
script: | | |
chmod +x /root/huisbot/deploy.sh | |
/root/huisbot/deploy.sh |