Deploy #370
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: Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
repository_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '12' | |
- run: apt-fast update && apt-fast install -y jq | |
- run: yarn install | |
- run: yarn build | |
- name: Publish | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
preCommands: | | |
export KV_NAMESPACE_ID=$(npx @cloudflare/wrangler@1 kv:namespace list 2> >(tee stderr.log >&2) | head -1 | node -pe "JSON.parse(fs.readFileSync('/dev/stdin').toString()).find(kv => kv.title.includes('KV_STATUS_PAGE')).id") | |
postCommands: | | |
env: | |
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
timestamp: | |
runs-on: ubuntu-latest | |
needs: deploy | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Timestamp | |
shell: bash | |
run: | | |
date >> ./timestamp | |
zone=$(TZ='Europe/Bratislava' date -r ./timestamp) | |
sed -i "11s/.*/$zone/" ./.github/README.md | |
git config --global user.email ${{ secrets.EMAIL }} | |
git config --global user.name ${{ secrets.NAME }} | |
git add ./.github/README.md | |
git commit -m "timestamp" ./.github/README.md | |
git push --force |