build: add autodeploy workflow
All checks were successful
Publish image / create-docker-images (push) Successful in 31s
Publish image / deploy (push) Successful in 15s

This commit is contained in:
Alexander Navarro 2024-12-09 10:49:01 -03:00
parent f3d7ff5d71
commit 893b80d262
3 changed files with 21 additions and 2 deletions

View file

@ -1,6 +1,8 @@
name: Publish image name: Publish image
on: on:
push: push:
branches:
- main
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -25,3 +27,20 @@ jobs:
tags: | tags: |
git.alecodes.page/alecodes/page:latest git.alecodes.page/alecodes/page:latest
git.alecodes.page/alecodes/page:${{ github.sha }} git.alecodes.page/alecodes/page:${{ github.sha }}
deploy:
runs-on: ubuntu-latest
needs:
- create-docker-images
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: 'Docker Stack Deploy'
uses: https://github.com/cssnr/stack-deploy-action@v1
with:
host: ${{ vars.DOCKER_SWARM_HOST }}
port: ${{ vars.DOCKER_SWARM_PORT }}
user: ${{ secrets.DOCKER_SWARM_USER }}
ssh_key: '${{ secrets.DOCKER_SWARM_SSH_KEY }}'
file: 'docker-stack.yaml'
name: 'personal-page'

View file

@ -2,4 +2,4 @@
+++ +++
# This is a awesome page :D # This is a **really** awesome page :D

View file

@ -4,7 +4,7 @@ networks:
services: services:
page: page:
image: git.alecodes.page/alecodes/page:latest image: git.alecodes.page/alecodes/page:${GITHUB_SHA:-latest}
restart: unless-stopped restart: unless-stopped
networks: networks:
- reverse-proxy - reverse-proxy