53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup Docker for QEMU
|
|
uses: https://github.com/papodaca/install-docker-action@main
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: code.f2n.me
|
|
username: ${{ secrets.MY_FORGEJO_USERNAME }}
|
|
password: ${{ secrets.MY_FORGEJO_TOKEN }}
|
|
- name: Build and push to local registry
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: code.f2n.me/finn/matrix-bot-invitation-mailer:latest
|
|
- name: Inspect
|
|
run: |
|
|
docker buildx imagetools inspect code.f2n.me/finn/matrix-bot-invitation-mailer:latest
|
|
- name: Deploy
|
|
uses: tristiisch/docker-stack-deployment@v2
|
|
with:
|
|
remote_docker_host: home.finnchristiansen.de
|
|
remote_docker_port: 44022
|
|
remote_docker_username: deploy
|
|
ssh_private_key: ${{ secrets.DOCKER_RPI4_SSH_PRIVATE_KEY }}
|
|
ssh_public_key: ${{ secrets.DOCKER_RPI4_SSH_PUBLIC_KEY }}
|
|
deployment_mode: docker-compose
|
|
copy_stack_file: false
|
|
deploy_path: /opt/stacks/matrix-bot-invitation-mailer
|
|
stack_file_path: ./compose.yaml
|
|
keep_files: 5
|
|
docker_remove_orphans: true
|
|
args: ""
|