This commit is contained in:
@@ -8,13 +8,13 @@ jobs:
|
||||
startsWith(gitea.event.comment.body, '/deploy')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get branch name
|
||||
id: branch_name
|
||||
uses: ./.gitea/actions/getTagSafeRef
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# - name: Build and push image
|
||||
# id: docker_build
|
||||
# uses: ./.gitea/actions/build
|
||||
@@ -23,46 +23,21 @@ jobs:
|
||||
# REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
||||
# REGISTRY_USER: ${{ gitea.actor }}
|
||||
|
||||
# - name: Deploy application
|
||||
# uses: ./.gitea/actions/deploy
|
||||
# with:
|
||||
# project_name: ${{ steps.branch_name.outputs.branch_name }}
|
||||
# url: '${{ steps.branch_name.outputs.branch_name }}.phoenix.klemp.local'
|
||||
# # image_url: ${{ steps.docker_build.outputs.image_url }}
|
||||
# image_url: 'git.klemp.dev/tech-reborn/phoenix:feature-branch-deployments'
|
||||
# deployment_key: ${{ secrets.SSH_DEPLOYMENT_KEY }}
|
||||
|
||||
- name: Setup SSH
|
||||
uses: webfactory/ssh-agent@v0.9.1
|
||||
- name: Deploy application
|
||||
uses: ./.gitea/actions/deploy
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.SSH_DEPLOYMENT_KEY }}
|
||||
|
||||
- name: Add SSH host to known hosts
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
ssh-keyscan -p ${{ vars.ssh_port }} ${{ vars.ssh_host }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Test SSH connection
|
||||
run: |
|
||||
# Test basic SSH connection
|
||||
ssh -o StrictHostKeyChecking=no ${{ vars.ssh_user }}@${{ vars.ssh_host }} -p ${{ vars.ssh_port }} "echo 'SSH connection successful'"
|
||||
|
||||
- name: Test Docker via SSH
|
||||
run: |
|
||||
# Test Docker version through SSH
|
||||
ssh -o StrictHostKeyChecking=no ${{ vars.ssh_user }}@${{ vars.ssh_host }} -p ${{ vars.ssh_port }} "docker --version"
|
||||
|
||||
# Test Docker info through SSH
|
||||
ssh -o StrictHostKeyChecking=no ${{ vars.ssh_user }}@${{ vars.ssh_host }} -p ${{ vars.ssh_port }} "docker info --format '{{.ServerVersion}}'"
|
||||
project_name: ${{ steps.branch_name.outputs.branch_name }}
|
||||
url: '${{ steps.branch_name.outputs.branch_name }}.phoenix.klemp.local'
|
||||
# image_url: ${{ steps.docker_bui ld.outputs.image_url }}
|
||||
image_url: 'git.klemp.dev/tech-reborn/phoenix:feature-branch-deployments'
|
||||
deployment_key: ${{ secrets.SSH_DEPLOYMENT_KEY }}
|
||||
ssh_host: ${{ vars.ssh_host }}
|
||||
ssh_port: ${{ vars.ssh_port }}
|
||||
ssh_user: ${{ vars.ssh_user }}
|
||||
|
||||
- name: Create environment file
|
||||
run: |
|
||||
cat > .env << EOF
|
||||
IMAGE_URL='git.klemp.dev/tech-reborn/phoenix:feature-branch-deployments'
|
||||
URL='${{ steps.branch_name.outputs.branch_name }}.phoenix.klemp.local'
|
||||
REGISTRY=git.klemp.dev
|
||||
PROJECT_NAME=${{ steps.branch_name.outputs.branch_name }}
|
||||
COMPOSE_PROJECT_NAME=${{ steps.branch_name.outputs.branch_name }}
|
||||
TOLGEE_API_URL=${{ vars.TOLGEE_API_URL }}
|
||||
TOLGEE_API_KEY=${{ secrets.TOLGEE_API_KEY }}
|
||||
TRANSLATION_CACHE_TTL=${{ vars.TRANSLATION_CACHE_TTL }}
|
||||
|
||||
Reference in New Issue
Block a user