Skip to content

Winner Banners for after game #2354

Winner Banners for after game

Winner Banners for after game #2354

Workflow file for this run

name: Node CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: npm install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci
env:
CI: true
- name: npm build
run: |
npm run build --if-present
env:
CI: true
- name: Save theme data
uses: actions/upload-artifact@v4
with:
name: themedata
path: dist
- name: Save branch targets
uses: actions/upload-artifact@v4
with:
name: branch-targets
path: branch-targets.txt
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download branch-targets
uses: actions/download-artifact@v4
with:
name: branch-targets
- name: Determine target
shell: python
run: |
from fnmatch import fnmatch
import os
import re
ref = "${{ github.ref }}"
for line in open("%s/branch-targets.txt" % os.environ['GITHUB_WORKSPACE']):
pattern, target = re.split(r'\s*:\s*', line.strip())
target = target.strip()
pattern = 'refs/heads/' + pattern
if fnmatch(ref, pattern):
print("Setting target to /r/%s" % target)
with open(os.environ['GITHUB_ENV'], 'a') as fp:
fp.write("SUBREDDIT=%s\n" % target)
break
else:
print("::warning ::No target found matching ref=" + ref)
- name: Download theme data
if: env.SUBREDDIT != ''
uses: actions/download-artifact@v4
with:
name: themedata
path: downloaded_theme
- name: Deploy to reddit
if: env.SUBREDDIT != ''
uses: redditnfl/publish-reddit-stylesheet-action@v1.3.1
with:
subreddit: ${{ env.SUBREDDIT }}
path: downloaded_theme
cleanup: true
env:
praw_client_id: ${{ secrets.style_publisher_praw_client_id }}
praw_client_secret: ${{ secrets.style_publisher_praw_client_secret }}
praw_refresh_token: ${{ secrets.style_publisher_praw_refresh_token }}