Skip to content

Version 2.4.1

Version 2.4.1 #5

Workflow file for this run

# 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: Publish
on:
release:
types: [created]
workflow_dispatch:
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cd bot
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
# Workaround for git+ssh:// dependencies not working
- run: |
git config --global url."https://github.com/".insteadOf git@github.com
git config --global url."https://".insteadOf ssh://
- run: npm ci
- run: npm run build --if-present
publish-npm:
needs: [build]
name: Publish NPM package
runs-on: ubuntu-latest
defaults:
run:
working-directory: bot
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-docker:
needs: [build]
name: Publish Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker metadata (bot)
id: meta-bot
uses: docker/metadata-action@v5
with:
images: |
gamestatus/gamestatus-bot
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Docker metadata (scheduler)
id: meta-scheduler
uses: docker/metadata-action@v5
with:
images: |
gamestatus/gamestatus-scheduler
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: Build and push (bot)
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile.bot
push: true
tags: ${{ steps.meta-bot.outputs.tags }}
labels: ${{ steps.meta-bot.outputs.labels }}
- name: Build and push (scheduler)
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile.scheduler
push: true
tags: ${{ steps.meta-scheduler.outputs.tags }}
labels: ${{ steps.meta-scheduler.outputs.labels }}