添加gitea actions配置用于自动构建

master
ModerRAS 2 years ago
parent 8683bbee1f
commit 84fbe53b7e

@ -0,0 +1,46 @@
name: Build And Deploy
on:
push:
branches:
- master
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: 'true'
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: moderras/kotadoc:latest
- name: Deploy to Server
uses: cross-the-world/ssh-scp-ssh-pipelines@v1.1.4
with:
# ssh remote host
host: ${{ secrets.SERVER_IP }}
# ssh remote port
port: ${{ secrets.SERVER_PORT }}
# ssh remote user
user: ${{ secrets.SERVER_CREDENTIALS_USR }}
# ssh remote password
pass: ${{ secrets.SERVER_CREDENTIALS_PSW }}
# execute pre-commands before scp
first_ssh: kubectl delete pods kotadoc && kubectl apply -f /data/kotadoc/kotadoc.yaml
Loading…
Cancel
Save