Update README.md #413
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: Record | |
on: | |
push: | |
branches: [ dev, main, dev-fixups ] | |
workflow_dispatch: | |
jobs: | |
make-gif: | |
if: ${{ contains(github.event.head_commit.message, '[docs]') || github.event_name == 'workflow_dispatch' }} # only run if commit message contains [docs] or workflow_dispatch | |
runs-on: ubuntu-latest | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install termcolor | |
- name: Install asciinema | |
run: | | |
sudo apt-add-repository ppa:zanchey/asciinema -y | |
sudo apt-get update -y | |
sudo apt-get install asciinema -y | |
- name: Recording | |
run: | | |
# go through all json in src, put sh into dist | |
python3 resources/actions/autocon/gif_automate.py asc | |
- name: Download agg | |
run: wget https://github.com/asciinema/agg/releases/latest/download/agg-x86_64-unknown-linux-gnu -O agg | |
- name: Make agg executable | |
run: chmod +x agg | |
- name: Convert to gif | |
run: python3 resources/actions/autocon/gif_automate.py gif | |
- name: Move gif | |
run: | | |
mkdir -p resources/actions/autocon/dist/docs | |
mv resources/actions/autocon/dist/*.gif resources/actions/autocon/dist/docs | |
- name: π Deploy FTP | |
uses: SamKirkland/FTP-Deploy-Action@4.3.2 | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USER }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
state-name: '.ftp-deploy-sync-state-images.json' | |
local-dir: "resources/actions/autocon/dist/docs/" | |
server-dir: "doc-images/" | |
# - name: Upload gif | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# # upload all gifs in resources/actions/autocon/dist | |
# name: gifs | |
# path: resources/actions/autocon/dist | |
# - name: Upload asciinema | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# # upload all ascs in resources/actions/autocon/src | |
# name: ascs | |
# path: resources/actions/autocon/src/*.asc | |
# - name: Commit changes | |
# run: | | |
# git config --local user.name "GitHub Actions" | |
# git add resources/docs/ | |
# git commit -m 'Update gifs' | |
# - name: Push changes | |
# uses: ad-m/github-push-action@master | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# branch: ${{ env.BRANCH_NAME }} | |