Files
md-blog/.github/workflows/deploy.yml
T
klemek 44a08ad715
Deploy / build (push) Successful in 3m43s
Deploy / deploy (push) Successful in 1m48s
fix(actions): clone articles repo before build
2026-05-01 23:25:51 +02:00

48 lines
1.1 KiB
YAML

name: Deploy
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: https://github.com/oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/checkout@v6
- run: bun ci
- uses: actions/checkout@v6
with:
repository: ${{ vars.ARTICLES_REPOSITORY }}
ref: main
token: ${{ secrets.PRIVATE_CLONE_TOKEN }}
path: ./articles
- run: bun run build
- uses: actions/upload-artifact@v3
with:
name: production-files
path: dist/
deploy:
runs-on: ubuntu-latest
needs: build
if: ${{ vars.STAPLER_TARGET != '' }}
steps:
- uses: actions/download-artifact@v3
with:
name: production-files
path: ./dist
- run: tar -czC dist -f dist.tar.gz .
- run: |
curl -s -X PUT --data-binary "@dist.tar.gz" \
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
${{ vars.STAPLER_CURL_ARGS }} \
${{ vars.STAPLER_TARGET }}