add output.yml #8
This file contains 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
# here we define a workflow with two jobs | |
# the two jobs will run in parallel | |
# this may not be ideal | |
# typically you would want your tests to pass before | |
# deploying the code | |
name: Deploy Project | |
# a workflow can have multiple triggers | |
# here we will set the trigger to both push and | |
# workflow_dispatch (manual) | |
on: [push, workflow_dispatch] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get code from repository | |
uses: actions/[email protected] | |
- name: Install NodeJS | |
uses: actions/[email protected] | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
deploy: | |
# the deploy job needs the | |
# test job to finish before | |
# it starts. | |
# needs: [test, foo, bar] to wait for multiple | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get code from repository | |
uses: actions/[email protected] | |
- name: Install NodeJS | |
uses: actions/[email protected] | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
- name: Deploy | |
run: echo "Deploying to AWS" |