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
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx 🚀
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
with:
|
||||
since_last_remote_commit: true
|
||||
separator: ","
|
||||
|
||||
- name: Login to Docker Hub 🚢
|
||||
uses: docker/login-action@v3
|
||||
- name: Copy repository contents
|
||||
uses: appleboy/scp-action@0.1.7
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and push 🏗️
|
||||
uses: docker/build-push-action@v2
|
||||
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:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: false
|
||||
# tags: |
|
||||
# ${{ secrets.DOCKER_HUB_USERNAME}}/{docker_repository}:${{ github.sha }}
|
||||
# ${{ secrets.DOCKER_HUB_USERNAME}}/{docker_repository}:latest
|
||||
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