Skip to content

[#475]: deploy to swarm action update #36

[#475]: deploy to swarm action update

[#475]: deploy to swarm action update #36

Workflow file for this run

name: 'Blog build, push and deploy'
on:
workflow_dispatch:
branches:
- master
push:
branches: [ master, 475-modify-deploy-to-swarm-action-to-use-with-yandex-cloud ]
paths:
- 'apps/blog/**'
- '.deploy/blog.deploy.yml'
- '.docker/Blog_Dockerfile*'
- '.github/workflows/blog-deploy.yml'
- '.github/actions/deploy-to-swarm/**'
jobs:
build-blog-image:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760
- name: Docker login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: |
ghcr.io/memebattle/blog:${{ github.sha }}
ghcr.io/memebattle/blog:latest
context: '.'
file: '.docker/Blog_Dockerfile'
cache-from: type=gha,scope=$GITHUB_REF_NAME-blog
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-blog
deploy:
needs: [build-blog-image]
runs-on: ubuntu-22.04
environment:
name: Blog-production
url: https://blog.mems.fun
steps:
- uses: actions/checkout@main
name: Checkout
- uses: ./.github/actions/deploy-to-swarm
name: Deploy to swarm lambda
with:
path-to-stack: '.deploy/blog.deploy.yml'
name: 'BLOG'
sa_auth_key: ${{ secrets.YC_WORKER_KEY }}
docker_registry_login: ${{ secrets.GHCR_USER }}
docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }}
docker_registry: 'ghcr.io'