Gen Members Pages #1652
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: Gen Members Pages | |
on: | |
schedule: | |
- cron: "1 0 * * *" | |
workflow_dispatch: | |
jobs: | |
run-gen-members: | |
runs-on: ubuntu-20.04 | |
outputs: | |
members_updated: ${{ steps.commit.outputs.members_updated }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Update member list | |
env: | |
TWITCH_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }} | |
TWITCH_CLIENT_SECRET: ${{ secrets.TWITCH_CLIENT_SECRET }} | |
run: | | |
cd scripts/genMembers | |
npm ci | |
npm start | |
- name: Recreate mission statement collage | |
run: | | |
cd scripts/genMissionStatementImage | |
npm ci | |
npm start | |
- name: Commit changes & build site | |
id: commit | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
git pull origin master | |
git add . | |
git commit -m "Updating members" && echo "::set-output name=members_updated::true" || echo "::set-output name=members_updated::false" | |
git push origin master | |
build-site: | |
runs-on: ubuntu-latest | |
if: contains(needs.run-gen-members.outputs.members_updated, true) | |
needs: [run-gen-members] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Removing locks | |
run: rm package-lock.json | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y libvips-dev build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev | |
- name: Build Site | |
run: | | |
CXXFLAGS="--std=c++14" npm install | |
npm run build | |
- name: Upload public dir as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: public-dir | |
path: public/ | |
gen-og-images: | |
runs-on: ubuntu-latest | |
if: contains(needs.run-gen-members.outputs.members_updated, true) | |
needs: [run-gen-members] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Build files | |
run: | | |
cd scripts/genOGImages | |
npm ci | |
npm start | |
- name: Upload files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: og-images | |
path: scripts/genOGImages/dist/members/ | |
deploy-site: | |
needs: [gen-og-images, build-site] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: get public dir | |
uses: actions/download-artifact@v3 | |
with: | |
name: public-dir | |
path: public | |
- name: get og-images dir | |
uses: actions/download-artifact@v3 | |
with: | |
name: og-images | |
path: public/og/members/ | |
- name: Deploy Site | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
run: npx netlify-cli deploy --dir=public --prod |