Reputation: 25413
I have a repo which attempts to serve an index.html file using
the NPM serve
module in a GitHub action.
Here's what the action looks like (.github/workflows/deploy.yml
):
name: test-serve-deploy
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "Clone complete"
- name: install
run: |
npm install
- name: serve
run: |
npm run serve
- run: echo "Status ${{ job.status }}"
I understand that the content in my repo is just an index.html file and could be served statically with GitHub Pages, but this is just a test repo I'm using to understand how GitHub actions work.
When the action runs, it predictably hangs on the npm run serve
:
However, this URL returns a 404: http://jonbri.github.io/test-serve:3000
I'm sure I'm missing something fundamental about how these actions/runners work. My goal is to have the GitHub repo not only deploy but also serve a Node.js app.
What steps would I need to take to get this working?
Upvotes: 0
Views: 278
Reputation: 665
Github runners are ephemeral. They just run the commands you provide and exit.
They cannot serve pages. If you want to serve content, you might want to use your github runner to deploy your content to a provider such as netlify or aws s3, lambda etc.
Upvotes: 1