Add Docker information to README #291
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
name: CICD 🚀 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
format-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- run: npm run format-check | |
build-web: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- run: npm run build:web | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build-web | |
path: dist_web | |
if-no-files-found: error | |
build-node: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- run: npm run build:node | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build-node | |
path: dist | |
if-no-files-found: error | |
test: | |
runs-on: ubuntu-latest | |
needs: [build-web] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-web | |
path: dist_web | |
- run: npm run test | |
- uses: codecov/codecov-action@v3 | |
gen-demo: | |
runs-on: ubuntu-latest | |
needs: [build-web, build-node] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-web | |
path: dist_web | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-node | |
path: dist | |
- run: npm link | |
- name: Download demo input files | |
run: | | |
curl -s -L "https://drive.usercontent.google.com/download?id=1SqHZqKstFem9qf1kgusuhiGUcE3xY8KQ&confirm=t" -o export.zip | |
unzip -qq -O utf8 export.zip -d export | |
- name: Generate demo report | |
run: | | |
chat-analytics -p discord -i export/*.json -o demo.html --demo | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: demo | |
path: demo.html | |
if-no-files-found: error | |
# store PR number for previews, see preview.yml | |
pr: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo ${{ github.event.number }} > pr.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pr | |
path: pr.txt | |
deploy: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: [build-web, gen-demo] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-web | |
path: dist_web | |
- uses: actions/download-artifact@v3 | |
with: | |
name: demo | |
path: dist_web | |
- uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: chat-analytics | |
directory: dist_web | |
branch: main |