1
0
www.mikescher.com/.gitea/workflows/website.yml
Mike Schwörer 315c32983c
All checks were successful
Build Docker and Deploy / Build Docker (push) Successful in 8s
Build Docker and Deploy / Deploy to Server (push) Successful in 14s
[CICD] Switch to gitea-actions as CI/CD
2023-08-26 21:21:44 +02:00

44 lines
1.3 KiB
YAML

# https://docs.gitea.com/next/usage/actions/quickstart
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
name: Build Docker and Deploy
run-name: Build & Deploy ${{ gitea.ref }} on ${{ gitea.actor }}
on:
push:
branches: ['master']
jobs:
build:
name: Build Docker
runs-on: bfb-cicd-latest
steps:
- run: echo -n "${{ secrets.DOCKER_REG_PASS }}" | docker login registry.blackforestbytes.com -u docker --password-stdin
- run: echo -n "${{ secrets.DOCKER_IO_PASS }}" | docker login -u "${{DOCKER_IO_USER}}" --password-stdin
- name: Check out code
uses: actions/checkout@v3
- run: cd "${{ gitea.workspace }}" && make clean
- run: cd "${{ gitea.workspace }}" && make docker
- run: cd "${{ gitea.workspace }}" && make push-docker
deploy:
name: Deploy to Server
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Deploy [develop] on remote (via ssh)
uses: appleboy/ssh-action@v1.0.0
with:
host: mikescher.com
username: deploybot
port: 7919
key: "${{ secrets.SSH_KEY_MSCOMDEPLOYBOT }}"
script: sudo /var/docker/__run/website.sh