Some checks failed
Docker Build & Publish / Build Docker (push) Failing after 15s
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Docker Build & Publish
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Docker
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@v44
|
|
with:
|
|
separator: ","
|
|
|
|
- name: Copy repository contents
|
|
uses: appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: ${{ secrets.HOST }}
|
|
port: ${{ secrets.PORT }}
|
|
username: ${{ secrets.USERNAME }}
|
|
key: ${{ secrets.KEY }}
|
|
passphrase: ${{ secrets.PASSPHRASE }}
|
|
source: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
target: ${{ secrets.REMOTE_PATH }}
|
|
|
|
- name: Restart remote application
|
|
uses: appleboy/ssh-action@v1.0.3
|
|
with:
|
|
host: ${{ inputs.host }}
|
|
port: ${{ inputs.port }}
|
|
username: ${{ inputs.username }}
|
|
key: ${{ secrets.KEY }}
|
|
passphrase: ${{ secrets.PASSPHRASE }}
|
|
script: cd ${{ secrets.remote-path }} && docker build . && docker run -p 3000:3000
|