diff --git a/.github/actions/jshint/Dockerfile b/.github/workflows/jshint/Dockerfile similarity index 100% rename from .github/actions/jshint/Dockerfile rename to .github/workflows/jshint/Dockerfile diff --git a/.github/workflows/jshint/action.yml b/.github/workflows/jshint/action.yml new file mode 100644 index 0000000..5715c5e --- /dev/null +++ b/.github/workflows/jshint/action.yml @@ -0,0 +1,4 @@ +name: 'jshint' +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..862732f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,19 @@ +name: test-and-deploy +on: push + +jobs: + test: + runs-on: ubuntu-latest + container: + image: node:11.6.0 + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npm test + - uses: ./.github/workflows/jshint + + deploy: + runs-on: ubuntu-latest + needs: test + steps: + - run: env diff --git a/README.md b/README.md index 27703bd..cfec703 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ Simple Node.js application to demonstrate the use of GitHub Actions # Look Ma, no Makefile! -All the tasks necessary for testing, building and deploying this code is already defined in `.github/main.workflow` so why would you want to also create a `Makefile` for local development? Now you can use [act](https://github.com/nektos/act) to run the actions locally! +All the tasks necessary for testing, building and deploying this code is already defined in `.github/workflows/` so why would you want to also create a `Makefile` for local development? Now you can use [act](https://github.com/nektos/act) to run the actions locally! Try these: -* `act -a lint` - run the linter -* `act -a test` - run the tests +* `act -j lint` - run the linter +* `act -j test` - run the tests * `act` - run the the entire pipeline * `act -l` - view the execution graph