2024-06-26 19:52:11 +02:00
|
|
|
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
|
2024-07-01 21:20:42 +02:00
|
|
|
|
2024-07-01 22:50:26 +02:00
|
|
|
- name: Do Docker Compose Pull via SSH
|
|
|
|
uses: https://github.com/appleboy/ssh-action@v1.0.3
|
2024-06-30 20:41:51 +02:00
|
|
|
with:
|
2024-07-01 22:50:26 +02:00
|
|
|
key: ${{ secrets.DOCKER_RPI4_SSH_PRIVATE_KEY }}
|
2024-07-02 21:34:28 +02:00
|
|
|
host: ${{ secrets.DOCKER_RPI4_SSH_HOSTNAME }}
|
|
|
|
username: ${{ secrets.DOCKER_RPI4_SSH_USERNAME }}
|
|
|
|
port: ${{ secrets.DOCKER_RPI4_SSH_PORT }}
|
2024-07-01 22:50:26 +02:00
|
|
|
script: |
|
|
|
|
cd /opt/stacks/matrix-bot-invitation-mailer
|
|
|
|
docker compose pull && docker compose up -d --force-recreate
|