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

68 lines
2.4 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 }}
permission-contents: write
permission-pull-requests: write
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: 'main'
- name: Setup Mise
uses: immich-app/devtools/actions/use-mise@06a9ef925332c91be647d6256642b86b398592c8 # use-mise-action-v3.2.1
with:
github_token: ${{ steps.generate-token.outputs.token }}
- name: Get pnpm store directory
id: pnpm-store
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install
run: pnpm install --frozen-lockfile
- 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: mise import-post "$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 }}'