0

I am trying to setup up a simple CD workflow through github actions that deploys my meteor starter project on ec2 whenever i make a commit to the main branch. I have successfully configure my ec2 and mup.js to be able to deploy the project by running mup deploy. i now have issues setting up a github actions, seems like it has something to do with my pem file?

error:

[54.167.25.39] - Pushing Meteor App Bundle to the Server

Error: Cannot parse privateKey: Unsupported key format

cd.yml

name: CI/CD Pipeline
run-name: ${{ github.actor }} is testing out GitHub Actions 

on:
  push:
    branches:
      - main
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest

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

      - name: Set up Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 14

      - name: Set up Meteor
        uses: meteorengineer/setup-meteor@v1
        with:
          meteor-release: '2.12'
        
      - name: Install mup
        run: npm install -g mup

      - name: Install dependencies
        run: npm install
 
      - name: Deploy to EC2 # ---------------------Fails over here------------
        run: |
          cd app-deploy 
          echo "$MUP_PEM_FILE" > placeholder.pem
          mup deploy
        # env: 
        #   MUP_PEM_FILE: ${{secrets.MUP_PEM_FILE}}

mup.js

module.exports = {
  servers: {
    one: {
      host: 'x.x.x.x',
      username: 'ubuntu',
      pem: './placeholder.pem'
    }
  },

  app: {
    name: 'testing-meteor-app',
    path: '../',
    servers: {
      one: {},
    },

    buildOptions: {
      serverOnly: true,
    },

    env: {
      ROOT_URL: 'http://x.x.x.x',
      MONGO_URL: 'mongodb://mongodb/meteor',
      MONGO_OPLOG_URL: 'mongodb://mongodb/local',
    },

    docker: {
      image: 'zodern/meteor:latest',
      // deployCheckWaitTime: 60
    },
    enableUploadProgressBar: true
  },

  mongo: {
    version: '4.4.12',
    servers: {
      one: {}
    }
  },
};

i have already added the contents of my pemfile into github's action's secrets with the key "MUP_PEM_FILE"

benwl
  • 366
  • 2
  • 17

0 Answers0