https://github.com/imatic/imatic-lxc-deploy-action
https://github.com/imatic/imatic-lxc-deploy-action
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/imatic/imatic-lxc-deploy-action
- Owner: imatic
- Created: 2023-12-12T15:10:19.000Z (over 2 years ago)
- Default Branch: dev
- Last Pushed: 2025-11-27T04:43:28.000Z (8 months ago)
- Last Synced: 2025-11-29T21:44:48.783Z (8 months ago)
- Language: Makefile
- Size: 29.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Imatic LXC Deploy Action
Deploys project to LXC instance.
## Requirements
This action require a docker-compose according to certain rules. The compose
file will be given same environment variables as in the build action. The rest
should be placed into deploy directory on the server, into the .env file.
Any references to `env_file` for services in docker-compose files will be
**removed**. Use explicit passing of environment variables in docker-compose file.
This removes the risk of passing variables to services which do not need them.
### Configuration
#### `DEPLOY_KEY`
This key is base64 encoded private key for ssh connection to the server. It needs
to be added to the server as authorized key for root user. It also needs to be
added to the **jumphost**.
## Usage in workflow
This is an example of deployment to stage.
```yaml
name: Deploy
on:
workflow_call:
inputs:
version:
type: string
description: "Version to deploy"
required: false
secrets:
DEPLOY_KEY:
required: true
workflow_dispatch:
inputs:
version:
description: "Version to deploy"
required: false
secrets:
DEPLOY_KEY:
required: true
env:
REGISTRY: ghcr.io
PROJECT: your-project-name-goes-here
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: imatic/imatic-lxc-deploy-action
with:
server: "root@${{ env.PROJECT }}-stage.lxc.imatic.cz"
server_deploy_key: ${{ secrets.DEPLOY_KEY }}
server_deploy_dir: "/opt/${{ env.PROJECT }}-stage"
project_domain_name: "stage.${{ env.PROJECT }}.dev.imatic.cz"
registry: ${{ env.REGISTRY }}
version: ${{ inputs.version }}
```