chore: Add CD to CI
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s

This commit is contained in:
Felix Dürrwald 2024-06-12 21:16:39 +02:00
parent bc19131a0a
commit 4cdcb1f47a
Signed by: mplabs
GPG Key ID: 6E7D7F464AC5179D

View File

@ -13,21 +13,30 @@ jobs:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx 🚀 - name: Get changed files
uses: docker/setup-buildx-action@v3 id: changed-files
uses: tj-actions/changed-files@v35
with:
since_last_remote_commit: true
separator: ","
- name: Login to Docker Hub 🚢 - name: Copy repository contents
uses: docker/login-action@v3 uses: appleboy/scp-action@0.1.7
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} host: ${{ secrets.HOST }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 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: Build and push 🏗️ - name: Restart remote application
uses: docker/build-push-action@v2 uses: appleboy/ssh-action@1.0.3
with: with:
context: . host: ${{ inputs.host }}
file: ./Dockerfile port: ${{ inputs.port }}
push: false username: ${{ inputs.username }}
# tags: | key: ${{ secrets.KEY }}
# ${{ secrets.DOCKER_HUB_USERNAME}}/{docker_repository}:${{ github.sha }} passphrase: ${{ secrets.PASSPHRASE }}
# ${{ secrets.DOCKER_HUB_USERNAME}}/{docker_repository}:latest script: cd ${{ secrets.remote-path }} && docker build . && docker run -p 3000:3000