43 lines
No EOL
1.6 KiB
YAML
43 lines
No EOL
1.6 KiB
YAML
name: Deploy Frontend
|
|
|
|
on:
|
|
workflow_dispatch: # Manual trigger
|
|
# schedule:
|
|
# - cron: '0 2 * * 0' # Check for updates every Sunday
|
|
|
|
jobs:
|
|
deploy-pages:
|
|
runs-on: ubuntu-latest
|
|
name: Deploy to Cloudflare Pages
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download latest web-vault release
|
|
run: |
|
|
# Get latest version tag
|
|
LATEST_TAG=$(curl -s https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest | jq -r .tag_name)
|
|
echo "Downloading version: $LATEST_TAG"
|
|
|
|
# Download corresponding tar.gz package (Note: bw_web_builds releases are typically named bw_web_tag.tar.gz)
|
|
wget "https://github.com/dani-garcia/bw_web_builds/releases/download/$LATEST_TAG/bw_web_${LATEST_TAG}.tar.gz"
|
|
|
|
# Extract to public directory (Cloudflare Pages default deployment directory)
|
|
mkdir public
|
|
tar -xvf bw_web_${LATEST_TAG}.tar.gz -C public/
|
|
|
|
# Fix: bw_web_builds usually extracts with a web-vault folder, need to move contents out
|
|
# Adjust based on actual extraction structure, usually contains index.html etc.
|
|
if [ -d "public/web-vault" ]; then
|
|
shopt -s dotglob
|
|
mv public/web-vault/* public/
|
|
shopt -u dotglob
|
|
rmdir public/web-vault
|
|
fi
|
|
|
|
- name: Deploy to Cloudflare Pages
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages deploy public --project-name=warden-frontend --branch=main |