Skip to content

Merge pull request #27 from glukki/update-deploy-action #27

Merge pull request #27 from glukki/update-deploy-action

Merge pull request #27 from glukki/update-deploy-action #27

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Create wrangler.toml
uses: bluwy/substitute-string-action@v3
with:
_input-file: 'wrangler.example.toml'
_output-file: 'wrangler.toml'
_format-key: '%%key%%'
LOGS: ${{ secrets.LOGS }}
SETTINGS: ${{ secrets.SETTINGS }}
HOOK_PATH: ${{ secrets.HOOK_PATH }}
TELEGRAM_API_TOKEN: ${{ secrets.TELEGRAM_API_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install
run: npm ci
- name: Build
run: npm run-script build
- name: Deploy
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: --version
postCommands: |
text="$(wrangler deploy)"
echo "value=${text##*$'\n'}" >> $GITHUB_OUTPUT
- name: Check status
uses: srt32/uptime@master
with:
url-to-hit: ${{ steps.deploy.outputs.value }}/status