v3.0.0 #9
Workflow file for this run
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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | |
name: Node.js Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- | |
name: Install dependencies | |
run: npm ci | |
- | |
name: Build | |
run: npm run build | |
- | |
run: | | |
cd dist | |
cp ../package.json . | |
cp ../LICENSE . | |
cp ../README.md . | |
npm pkg delete files | |
npm pkg delete scripts | |
npm pkg delete devDependencies | |
npm pkg set main=app.js | |
npm pkg set bin.werewolf-server=cli.js | |
npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
publish-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- | |
name: Install dependencies | |
run: npm ci | |
- | |
name: Build | |
run: npm run build | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/asmodee-werewolf-server:latest,${{ secrets.DOCKER_USERNAME }}/asmodee-werewolf-server:${{ github.ref_name }} |