Coder Social home page Coder Social logo

Comments (4)

JackMcKew avatar JackMcKew commented on June 13, 2024 1

A workaround to this problem is to use the npm package beanstalk-deploy under a run command in an action. This seems to work.

Example:

name: Test & Deploy
on: push

jobs:
  test-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Latest Repo
        uses: actions/checkout@master

      - name: Build Dev Docker Image
        run: docker build -t jackmckew/docker-react-dev -f Dockerfile.dev .

      - name: Run Test Suite
        run: docker run -e CI=true jackmckew/docker-react-dev npm run test -- --coverage

      # Zip Dockerfile for upload
      - name: Generate Deployment Package
        run: zip -r deploy.zip * -x "**node_modules**"

      - name: Get Timestamp
        uses: gerred/actions/current-time@master
        id: current-time

      - name: Run String Replace
        uses: frabert/replace-string-action@master
        id: format-time
        with:
          pattern: '[:\.]+'
          string: "${{ steps.current-time.outputs.time }}"
          replace-with: "-"
          flags: "g"

      # Deploy to AWS
      - name: Install Dependencies & Deploy to AWS
        run: |
          sudo npm install -g beanstalk-deploy --unsafe-perm
          sudo AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID}} AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY}} beanstalk-deploy "docker-react" "DockerReact-env-1" "docker-react-${{ steps.format-time.outputs.replaced }}" "us-east-2" deploy.zip
      # # Deploy to AWS
      # This doesn't work, complains not enough arguments and IS_GITHUB_ACTION evaluates to false
      # - name: Deploy to AWS ElasticBeanstalk
      #   uses: einaregilsson/beanstalk-deploy@v10
      #   with:
      #     aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
      #     aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      #     application_name: "docker-react"
      #     environment_name: "DockerReact-env"
      #     version_label: "docker-react-${{ steps.format-time.outputs.replaced }}"
      #     region: "us-east-2"
      #     deployment_package: deploy.zip
      #     version_description: ${{github.SHA}}

With successful action logs: https://github.com/JackMcKew/docker-react/runs/943201859?check_suite_focus=true

from beanstalk-deploy.

 avatar commented on June 13, 2024

Funny, since that NPM package is the exact same script :D . But I've fixed the detection stuff now, try using v11 of the action.

from beanstalk-deploy.

JackMcKew avatar JackMcKew commented on June 13, 2024

Thank you so much @einaregilsson for the quick response! I've deleted my beanstalk instance now, but I'll be sure to give it another go soon!

from beanstalk-deploy.

JackMcKew avatar JackMcKew commented on June 13, 2024

@einaregilsson Confirmed working now! Thank you so much!

Working version in: https://github.com/JackMcKew/multi-docker/blob/master/.github/workflows/build-docker.yml

from beanstalk-deploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.