Actions Commit.
This commit is contained in:
46
shotreact/.gitea/workflows/default.yml
Normal file
46
shotreact/.gitea/workflows/default.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Gitea CI/CD
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Login to Docker registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: https://registry.rokoh.com
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build . -t shotreact:latest -f shotreact/Dockerfile
|
||||
|
||||
- name: Tag Docker image
|
||||
run: docker tag shotreact:latest registry.rokoh.com/shotreact:latest
|
||||
|
||||
- name: Push Docker image to registry
|
||||
run: docker push registry.rokoh.com/shotreact:latest
|
||||
|
||||
- name: SSH Deploy
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: 10.1.1.90
|
||||
username: ${{ secrets.SERVER_USERNAME }}
|
||||
password: ${{ secrets.SERVER_PASSWORD }}
|
||||
script: |
|
||||
if docker ps -a --format '{{.Names}}' | grep -q shotreact; then
|
||||
docker stop shotreact || true
|
||||
docker rm shotreact || true
|
||||
docker image rm shotreact:latest
|
||||
fi
|
||||
docker login registry.rokoh.com -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} && docker image pull registry.rokoh.com/shotreact:latest
|
||||
docker run -d -p 2000:80 --restart=always --name shotreact registry.rokoh.com/shotreact
|
||||
docker image prune -f
|
||||
|
||||
- name: Prune Docker resources
|
||||
run: docker system prune -af --volumes
|
||||
BIN
shotreact/wwwroot/img/favicon.png
Normal file
BIN
shotreact/wwwroot/img/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Reference in New Issue
Block a user