Abhinandan Goyal
Abhinandan Goyal

Reputation: 3

Github workflows action continuous deployment not working

I want to setup continuous deployment pipeline between Github and AWS Lambda. For this, I've added main.yml file @ myrepo/.github/workflows/main.yml

This is my main.yml file

name: deploy to lambda
on:
  # Trigger the workflow on push or pull request,
  # but only for the main branch
  push:
    branches:
      - main
jobs:

  deploy_source:
    name: deploy lambda from source
    runs-on: ubuntu-latest
    steps:
      - name: checkout source code
        uses: actions/checkout@v1
      - name: default deploy
        uses: appleboy/lambda-action@master
        with:
          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws_region: ${{ secrets.AWS_REGION }}
          function_name: my_function
          source: function.py

Now when I push changes to main branch nothing happens. It shows There are no workflow runs yet. I have checked the function_name and it is same as the function in AWS Console.

Upvotes: 0

Views: 166

Answers (3)

Fcmam5
Fcmam5

Reputation: 6812

As tj-cappelletti said in their answer, you should use your hosted runners.

And also, be sure that your pipeline is on your default branch. Otherwise, you wouldn't see it there.

Upvotes: 1

tj-cappelletti
tj-cappelletti

Reputation: 1864

Your deploy_source job has runs-on: ubuntu-latest which tells Actions to use a GitHub Hosted Runner. As per your comment, you are using GitHub Enterprise Server (GHES) which is a virtual appliance on your company's network. At present, GHES does not support using GitHub Hosted Runners (it's worth noting at the time of this writing, it is on the product roadmap for support).

If you wish to run your workflow, you will need to make use of a self-hosted hosted runner. I would recommend working with your GHES administrator to get this workflow to run as there are potentially other settings and/or steps that may need to be modified or taken for this to work.

Upvotes: 1

tjarbo
tjarbo

Reputation: 936

You need to place workflows in .github/workflows/. Note the dot in front of the folder name .github. So for your case the final path should look like this myrepo/.github/workflows/main.yml.

Upvotes: 0

Related Questions