Workflow config file is invalid. Please check your config file: yaml: line 8: did not find expected key
Felix Dürrwald 4cdcb1f47a
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
chore: Add CD to CI
2024-06-12 21:16:39 +02:00

43 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@v35
with:
since_last_remote_commit: true
separator: ","
- name: Copy repository contents
uses: appleboy/scp-action@0.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@1.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