chore: Add CD to CI
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
This commit is contained in:
parent
bc19131a0a
commit
4cdcb1f47a
@ -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
|
||||||
- name: Login to Docker Hub 🚢
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
since_last_remote_commit: true
|
||||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
separator: ","
|
||||||
|
|
||||||
- name: Build and push 🏗️
|
- name: Copy repository contents
|
||||||
uses: docker/build-push-action@v2
|
uses: appleboy/scp-action@0.1.7
|
||||||
with:
|
with:
|
||||||
context: .
|
host: ${{ secrets.HOST }}
|
||||||
file: ./Dockerfile
|
port: ${{ secrets.PORT }}
|
||||||
push: false
|
username: ${{ secrets.USERNAME }}
|
||||||
# tags: |
|
key: ${{ secrets.KEY }}
|
||||||
# ${{ secrets.DOCKER_HUB_USERNAME}}/{docker_repository}:${{ github.sha }}
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
# ${{ secrets.DOCKER_HUB_USERNAME}}/{docker_repository}:latest
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user