chore: Add CD to CI
Some checks failed
Docker Build & Publish / Build Docker (push) Failing after 39s
Some checks failed
Docker Build & Publish / Build Docker (push) Failing after 39s
This commit is contained in:
parent
bc19131a0a
commit
372f5d25da
@ -1,20 +0,0 @@
|
|||||||
name: Gitea Actions Demo
|
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Explore-Gitea-Actions:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
|
||||||
- name: List files in the repository
|
|
||||||
run: |
|
|
||||||
ls ${{ gitea.workspace }}
|
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
|
||||||
|
|
||||||
@ -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 }}
|
||||||
- name: Build and push 🏗️
|
key: ${{ secrets.KEY }}
|
||||||
uses: docker/build-push-action@v2
|
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:
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user