-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (77 loc) · 2.54 KB
/
demo.yaml
File metadata and controls
95 lines (77 loc) · 2.54 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build and Deploy Demo
on:
workflow_dispatch:
inputs:
demoPackage:
description: "Demo Environment"
required: true
default: "pyfunceble"
type: choice
options:
- pyfunceble
- pyfunceble-dev
jobs:
record_and_deploy_demo:
name: "Play and Deploy Demos"
if: github.event_name == 'workflow_dispatch'
runs-on: "ubuntu-latest"
container:
image: archlinux
options: --tty --interactive
steps:
- uses: actions/checkout@v3
name: Clone repository
with:
ref: react-src
- name: Get time for cache
id: cache_time
run: |
echo "time=$(date +%F-%T)" >> ${GITHUB_STATE}
- name: Set up cache
uses: actions/cache@master
with:
path: /var/cache/pacman/pkg
key: pacman-cache-x86_64-${{ steps.cache_time.outputs.time }}
restore-keys: pacman-cache-x86_64-
- name: Install dependencies
run: |
pacman -Syu --needed --noconfirm && \
pacman -S --needed --noconfirm git binutils pacman-contrib openssh rsync python python-setuptools jq python-pip asciinema
pip install --pre ${PYFUNCEBLE_PKG_NAME}
env:
PYFUNCEBLE_PKG_NAME: ${{ github.event.inputs.demoPackage }}
- name: Configure Dependencies
run: |
asciinemaConfigDir=${HOME}/.config/asciinema
asciinemaConfigFile=${asciinemaConfigDir}/install-id
[[ ! -d ${asciinemaConfigDir} ]] && mkdir -p ${asciinemaConfigDir}
printf "${{ secrets.ASCIINEMA_TOKEN }}" > ${asciinemaConfigFile}
git config --global user.name ${{ secrets.GIT_BOT_NAME }}
git config --global user.email ${{ secrets.GIT_BOT_EMAIL }}
# env:
# ASCIINEMA_TOKEN: ${{ secrets.ASCIINEMA_TOKEN }}
- name: Print asciinema version
run: asciinema --version
- name: Print PyFunceble version
run: pyfunceble --version
- name: Record landing demos
run: |
cd demo-scripts
./record_all.sh landing
cd -
- name: Upload landing demos
run: |
cd demo-scripts
./upload_all.sh landing
cd -
- name: Install Demo links
run:
for file in /tmp/pyfunceble-demos/*.json
do
cat ${file} | jq > ./src/data/$(basename ${file})
done
- name: Push changes
run: |
git add ./src/data/*.json
git commit -m 'Update Demos'
git push origin react-src