Skip to content

Testing auto deploy on LightSail #1

Testing auto deploy on LightSail

Testing auto deploy on LightSail #1

name: Build Image and Deploy
on:
push:
branches:
- "devops/ssh"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Add .env
run: |
echo ${{ secrets.ENV }} >> .env
cat .env
- name: Build and push image
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: calebackom/monsters-rolodex
tags: latest
registry: docker.io
dockerfile: Dockerfile
directory: ./
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
deploy:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
./deploy.sh