Files
static-pages/.github/workflows/import-post.yml
T

52 lines
1.9 KiB
YAML

name: Import Outline post
on:
workflow_dispatch:
inputs:
post_url:
required: true
description: 'The URL of the post to import'
jobs:
import:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.PUSH_O_MATIC_APP_CLIENT_ID }}
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
ref: 'main'
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Import post
id: import
env:
OUTLINE_POST_URL: ${{ inputs.post_url }}
OUTLINE_API_KEY: ${{ secrets.OUTLINE_API_KEY }}
R2_BUCKET_NAME: ${{ secrets.STATIC_BUCKET_NAME }}
R2_ENDPOINT_URL: ${{ secrets.STATIC_BUCKET_ENDPOINT }}
R2_ACCESS_KEY_ID: ${{ secrets.STATIC_BUCKET_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.STATIC_BUCKET_KEY_SECRET }}
R2_PUBLIC_URL: 'https://static.immich.cloud'
run: uv run --script import-post.py "$OUTLINE_POST_URL"
- name: Create PR
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.generate-token.outputs.token }}
add-paths: apps/root.immich.app/src/routes/blog
commit-message: 'feat: import ${{ steps.import.outputs.slug }}'
title: 'feat: import ${{ steps.import.outputs.slug }}'
branch: 'blog/${{ steps.import.outputs.uuid }}'