Update index.js #385
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
name: Core CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Use Node.js 18 | |
uses: actions/setup-node@master | |
with: | |
node-version: '18' | |
- name: npm install | |
run: npm install | |
- name: npm test | |
run: npm test | |
pack-test: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Use Node.js 18 | |
uses: actions/setup-node@master | |
with: | |
node-version: '18' | |
- name: npm install | |
run: npm install | |
- name: npm pack | |
run: npm run pack | |
pack: | |
needs: pack-test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@master | |
- name: Use Node.js 18 | |
uses: actions/setup-node@master | |
with: | |
node-version: '18' | |
- name: npm install | |
run: npm install | |
- name: npm pack | |
run: npm run pack | |
- name: Release | |
uses: fnkr/github-action-ghr@v1 | |
env: | |
GHR_PATH: dist/ | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docker: | |
needs: test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: simon300000/ddathome-nodejs:latest |