2020-05-02 07:57:50 +02:00
|
|
|
name: Node.js CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-10-22 09:00:42 +02:00
|
|
|
node-version: [16.x]
|
2020-05-02 07:57:50 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- run: yarn
|
|
|
|
- run: yarn build
|
2021-08-27 05:24:52 +02:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
2021-09-13 06:12:55 +02:00
|
|
|
if: (github.ref == 'refs/heads/master') && (github.repository == 'citra-emu/discord-bot')
|
2021-08-27 05:24:52 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: docker/setup-buildx-action@v1
|
|
|
|
name: Setup Docker BuildX system
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- uses: docker/build-push-action@v2
|
|
|
|
name: Deploy the image
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
tags: citraemu/discord-bot:latest
|