-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.46 KB
/
Copy pathplay.yaml
File metadata and controls
55 lines (47 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Tic Tac Toe game
on:
workflow_dispatch:
push:
branches:
- master
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
game:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Play
id: play
run: |
SHA1=$(git rev-parse HEAD)
OUTPUT=$(cargo run $SHA1 | awk -F '### ' '{print $2}' | while read -r line; do printf "%s & " "$line"; done; printf "\n")
echo $OUTPUT
echo "::set-output name=commit_message::$OUTPUT"
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "$COMMIT_MESSAGE $(date +'%Y-%m-%dT%H:%M:%S')" -a
env:
COMMIT_MESSAGE: ${{ steps.play.outputs.commit_message }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAK }}