draw random cards from api #165
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: Engine Deployment | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build Main Branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v4 | |
- name: Build and Push Docker Image | |
uses: mr-smithers-excellent/docker-build-push@v6 | |
with: | |
image: techn1c/engine2shine | |
tags: latest | |
registry: docker.io | |
directory: engine2shine | |
dockerfile: engine2shine/Dockerfile | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
deploy_to_droplet: | |
runs-on: ubuntu-latest | |
needs: build | |
name: Deploy to Digital Ocean Droplet | |
steps: | |
- name: Connect with SSH and Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
docker login | |
docker stop engine2shine | |
docker remove engine2shine | |
docker pull techn1c/engine2shine:latest | |
docker run --name engine2shine -p 8080:80 -d techn1c/engine2shine:latest |