You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB
YAML

name: Build And Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
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