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