Skip to content

Move 1

Move 1 #29

Workflow file for this run

name: Update Game Board
on:
push:
branches:
- master
issues:
types: [opened]
jobs:
update_game_board:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Extract move from issue
id: extract_move
if: github.event_name == 'issues' && github.event.action == 'opened'
run: echo "move=$(echo ${{ github.event.issue.body }} | grep -oE '[A-C][1-3]')" >> $GITHUB_OUTPUT
- name: Generate board and image
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-south-1'
MOVE: ${{ steps.extract_move.outputs.move}}
run: node index.js
- name: Update README
run: |
timestamp=$(date +%s)
echo "![Game Board](https://tic-actions.s3.ap-south-1.amazonaws.com/game-board.png?t=${timestamp})" > README.md
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "RecursivelyBetter"
git add README.md
git commit --allow-empty -m "Update game board image"
git push