ci: ensure full git state in ci #54
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
# Also see: | |
# https://github.com/yavisht/deploy-via-surge.sh-github-action-template | |
# https://github.com/marketplace/actions/vhs-action | |
name: VHS Usage Recording 📼 | |
on: | |
push: | |
branches: [ "master" ] | |
paths: ['**/*.tape', '**/*.go', '.github/workflows/vhs.yml'] | |
workflow_dispatch: | |
jobs: | |
record: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pull Git Tags | |
run: git fetch --prune --unshallow | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Build Binary | |
run: go generate && go build -v -o nt | |
- name: Setup Tools | |
run: sudo apt-get update && sudo apt-get install ffmpeg jq && sudo snap install ttyd --classic && go install github.com/charmbracelet/vhs@v0.2 && npm install -g surge | |
- name: Setup BURNED Notion Token | |
run: export NOTION_SECRET="secret_rhsxWWqTWhEd1pLlEOLB2z5eVfilG1iqPGPjeqSU934" | |
- name: Setup Default Notion DB | |
run: export NOTION_DEFAULT_DB="979bf78281914ca5895555168b2f7396" | |
- name: Fake Time | |
run: sudo date -s "2023-01-23 12:00:00" | |
- name: VHS Recordings 📼 | |
run: for file in images/*.tape; do vhs "$file"; done | |
- name: Reset Time | |
run: sudo date -s "@$(curl 'http://worldtimeapi.org/api/timezone/America/New_York' | jq '.unixtime')" | |
- name: Setup Upload | |
run: mkdir UPLOAD && mv images/*.gif UPLOAD && echo "Usage gif storage for mfigurski80/NTPeek" > UPLOAD/index.html && ls UPLOAD | |
- name: Upload | |
run: surge UPLOAD ntpeek-usage.surge.sh --token ${{ secrets.SURGE_TOKEN }} |