Skip to content

blog: announce Poetry 2.1.0 #64

blog: announce Poetry 2.1.0

blog: announce Poetry 2.1.0 #64

Workflow file for this run

name: "Deploy Preview"
on:
pull_request:
# allow repository maintainers to modify and test workflow
paths:
- ".github/workflows/deploy-preview.yaml"
pull_request_target: # zizmor: ignore[dangerous-triggers]
# enable runs for this workflow when labeled as safe only
# prevent execution when the workflow itself is modified from a fork
types:
- labeled
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
jobs:
deploy-preview:
name: Build & Deploy
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe'))
|| (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
permissions:
deployments: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Build Assets
run: npm ci && npm run prod
- name: Fetch Documentation
run: |
python -m pip install poetry
poetry install --no-root --only main
poetry run python bin/website build
- name: Start Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: Preview
- name: Build
run: npx hugo --buildDrafts --buildFuture --logLevel info
- name: Deploy
uses: amondnet/vercel-action@v25
id: vercel-action
with:
vercel-version: 39.1.3
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: python-poetry
github-comment: true
working-directory: public
- name: Update Deployment Status
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.vercel-action.outputs.preview-url }}
env: ${{ steps.deployment.outputs.env }}