Tryfix manual pipeline
This commit is contained in:
@@ -64,7 +64,6 @@ jobs:
|
||||
echo "Creating env file as: $(whoami) in: $(pwd)"
|
||||
echo "GIT_COMMIT_HASH=${{ github.sha }}" >> .env
|
||||
ls -la .env
|
||||
source .env
|
||||
|
||||
- name: Log in to container registry
|
||||
uses: docker/login-action@v3
|
||||
@@ -74,12 +73,24 @@ jobs:
|
||||
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||
|
||||
- name: Docker Stack deploy
|
||||
uses: tristiisch/docker-stack-deployment@v2
|
||||
with:
|
||||
remote_docker_host: 192.168.1.105
|
||||
remote_docker_username: root
|
||||
ssh_private_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
||||
ssh_public_key: ${{ secrets.DEPLOY_SSH_PUBLIC_KEY }}
|
||||
deployment_mode: docker-swarm
|
||||
stack_file_path: "docker-compose.yml"
|
||||
stack_name: "lolstats"
|
||||
run: |
|
||||
echo "Running: ${0} as: $(whoami) in: $(pwd)"
|
||||
mkdir -p /root/.ssh
|
||||
chmod 0700 /root/.ssh
|
||||
ssh-keyscan -p "22" -H "192.168.1.105" >> /root/.ssh/known_hosts
|
||||
echo -e "\u001b[36mAdding SSH Key to SSH Agent"
|
||||
echo "${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}" > /root/.ssh/id_rsa
|
||||
chmod 0600 /root/.ssh/id_rsa
|
||||
eval "$(ssh-agent -s)"
|
||||
ssh-add /root/.ssh/id_rsa
|
||||
echo -e "\u001b[36mVerifying Docker and Setting Context."
|
||||
ssh -p "22" "root@$192.168.1.105" "docker info" > /dev/null
|
||||
docker context create remote --docker "host=ssh://root@192.168.1.105:22"
|
||||
docker context ls
|
||||
docker context use remote
|
||||
echo -e "\u001b[36mSourcing Environment File: .env"
|
||||
stat ".env"
|
||||
set -a
|
||||
source ".env"
|
||||
echo -e "\u001b[36mDeploying Stack: \u001b[37;1mlolstats"
|
||||
docker stack deploy -c "docker-compose.yml" "lolstats"
|
||||
|
||||
Reference in New Issue
Block a user