This repository has been archived by the owner on Feb 1, 2025. It is now read-only.
Publish tredtrix docker image #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish tredtrix docker image | |
# Controls when the workflow will run | |
on: | |
# Trigger the workflow on push | |
# but only for the master branch | |
push: | |
branches: | |
- master | |
# runs once every month | |
schedule: | |
- cron: "0 3 1 * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
push_to_registry: | |
name: Push tredtrix docker images to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Check out the repo | |
uses: actions/checkout@v4 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push tredtrix docker | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
target: tredtrix-deploy | |
tags: | | |
ghcr.io/jimmylevell/tredtrix/tredtrix:latest | |
- | |
name: Deploy to swarm | |
uses: wshihadeh/docker-deployment-action@v2 | |
with: | |
remote_docker_host: [email protected] | |
ssh_private_key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }} | |
ssh_public_key: ${{ secrets.DOCKER_SSH_PUBLIC_KEY }} | |
deployment_mode: docker-swarm | |
copy_stack_file: true | |
pull_images_first: true | |
deploy_path: /home/worker/levell/tredtrix | |
stack_file_name: docker-compose.prod.yml | |
keep_files: 2 | |
args: --with-registry-auth --prune tredtrix |