Skip to content

Commit

Permalink
Update node.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mnagaraju5628 committed Aug 8, 2024
1 parent 6724901 commit a1d6e39
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
name: Docker Build and Run
name: Deploy

on:
push:
branches:
- main

jobs:
build_and_run:
deploy:
runs-on: self-hosted

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image
- name: Decrypt credentials
run: |
docker build -t test_decrypt_credentials /home/mnagaraju/actions-runner/Testproject-inno/
# Path variables
CREDENTIALS_ENC="/home/mnagaraju/actions-runner/Testproject-inno/credentials.enc"
ENCRYPTION_KEY="/home/mnagaraju/actions-runner/Testproject-inno/encryption_key.txt"
CREDENTIALS="/home/mnagaraju/actions-runner/Testproject-inno/credentials.txt"
- name: Recreate Docker Container
# Decrypt the credentials
openssl enc -aes-256-cbc -pbkdf2 -d -in $CREDENTIALS_ENC -out $CREDENTIALS -pass file:$ENCRYPTION_KEY
if [ $? -ne 0 ]; then
echo "Decryption failed"
exit 1
fi
echo "Decryption succeeded"
- name: Deploy with Docker Compose
run: |
docker stop test_decrypt_credentials || true
docker rm test_decrypt_credentials || true
docker run --name test_decrypt_credentials -d test_decrypt_credentials
docker-compose -f /home/mnagaraju/actions-runner/Testproject-inno up -d

0 comments on commit a1d6e39

Please sign in to comment.