Skip to content

Commit 090d9cc

Browse files
authored
Merge pull request #59 from pelias/update-github-actions
Update GitHub actions
2 parents 1f6e3c6 + e2c7868 commit 090d9cc

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/push.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ jobs:
2020
- name: Run unit tests
2121
run: |
2222
npm install
23-
npm test
23+
npm run ci
2424
npm-publish:
2525
needs: unit-tests
2626
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
27-
runs-on: ubuntu-16.04
27+
runs-on: ubuntu-20.04
2828
steps:
2929
- uses: actions/checkout@v2
30-
- name: Install node.js 12.x
30+
- name: Install Node.js
3131
uses: actions/setup-node@v2-beta
3232
with:
33-
node-version: 12.x
33+
node-version: 16.x
3434
- name: Run semantic-release
3535
env:
3636
GH_TOKEN: ${{ secrets.GH_SEMANTIC_RELEASE_TOKEN }}
@@ -39,3 +39,17 @@ jobs:
3939
if [[ -n "$GH_TOKEN" && -n "$NPM_TOKEN" ]]; then
4040
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/semantic-release.sh" | bash -
4141
fi
42+
build-docker-images:
43+
# run this job if the unit tests passed and the npm-publish job was a success or was skipped
44+
# note: github actions won't run a job if you don't call one of the status check functions, so `always()` is called since it evalutes to `true`
45+
if: ${{ always() && needs.unit-tests.result == 'success' && (needs.npm-publish.result == 'success' || needs.npm-publish.result == 'skipped') }}
46+
needs: [unit-tests, npm-publish]
47+
runs-on: ubuntu-20.04
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Build Docker images
51+
env:
52+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
53+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
54+
run: |
55+
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash -

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"scripts": {
2222
"units": "node test/units.js",
2323
"test": "npm run units",
24+
"ci": "npm run units",
2425
"lint": "jshint .",
2526
"validate": "npm ls"
2627
},

0 commit comments

Comments
 (0)