Update theme handling and add login/register styles with new Bitcoin … #55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Production | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up SSH | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Add server to known hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| # Create SSH config file with custom port and user | |
| echo "Creating SSH config file..." | |
| cat > ~/.ssh/config << EOF | |
| Host profullstack.com 104.36.23.197 | |
| HostName 104.36.23.197 | |
| User ubuntu | |
| Port 2048 | |
| EOF | |
| chmod 600 ~/.ssh/config | |
| # Run ssh-keyscan with the correct port | |
| echo "Running ssh-keyscan with custom port..." | |
| # The -p flag is for the port, -T disables pseudo-terminal allocation | |
| ssh-keyscan -p 2048 -T 60 104.36.23.197 > /tmp/known_hosts_entry | |
| # Check if ssh-keyscan succeeded | |
| if [ -s /tmp/known_hosts_entry ]; then | |
| echo "Successfully retrieved host key:" | |
| cat /tmp/known_hosts_entry | |
| # Add the host key to known_hosts | |
| cat /tmp/known_hosts_entry >> ~/.ssh/known_hosts | |
| chmod 644 ~/.ssh/known_hosts | |
| else | |
| echo "Failed to retrieve host key via ssh-keyscan, using provided key..." | |
| echo "${{ secrets.SERVER_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | |
| chmod 644 ~/.ssh/known_hosts | |
| fi | |
| # Verify the files exist and have content | |
| ls -la ~/.ssh/ | |
| echo "Content of SSH config:" | |
| cat ~/.ssh/config | |
| echo "Lines in known_hosts:" | |
| wc -l ~/.ssh/known_hosts | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y rsync zsh curl file golang postgresql-client gnome-keyring dbus-x11 | |
| # Set up dbus for gnome-keyring | |
| echo "Setting up dbus and gnome-keyring..." | |
| mkdir -p ~/.cache | |
| dbus-launch --sh-syntax > ~/.cache/dbus-env | |
| source ~/.cache/dbus-env | |
| # Initialize the keyring | |
| echo "Initializing gnome-keyring..." | |
| echo -n "password" | gnome-keyring-daemon --unlock | |
| # Export environment variables for subsequent steps | |
| echo "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}" >> $GITHUB_ENV | |
| - name: Create .env file from secret | |
| run: | | |
| # Create .env file from GitHub secret | |
| echo "${{ secrets.ENV_FILE_CONTENT }}" > .env | |
| # Print confirmation (without showing the content for security) | |
| echo "Created .env file with $(grep -c '' .env) lines" | |
| - name: Prepare for deployment | |
| run: | | |
| # Make scripts executable | |
| chmod +x ./bin/supabase-db.sh | |
| chmod +x ./bin/deploy.sh | |
| chmod +x ./bin/deploy-with-migrations.sh | |
| # Debug: Check .env file existence | |
| echo "Checking .env file..." | |
| if [ -f .env ]; then | |
| echo ".env file exists with $(grep -c '' .env) lines" | |
| else | |
| echo ".env file does not exist" | |
| fi | |
| - name: Deploy to server with migrations | |
| run: | | |
| # Print debug info | |
| echo "Current directory: $(pwd)" | |
| echo "Files in bin directory:" | |
| ls -la ./bin | |
| # Run deploy script with migrations | |
| ./bin/deploy-with-migrations.sh | |
| # Run test script to verify deployment | |
| echo "Running test script on remote server..." | |
| ssh -p 2048 [email protected] "cd $DEPLOY_REMOTE_DIR && chmod +x bin/test-github-actions.sh && ./bin/test-github-actions.sh" | |
| env: | |
| DEPLOY_REMOTE_HOST: 104.36.23.197 | |
| DEPLOY_REMOTE_PORT: 2048 | |
| DEPLOY_REMOTE_USER: ubuntu | |
| DEPLOY_REMOTE_DIR: www/profullstack.com/pdf | |
| INSTALL_SERVICE: true |