Files
static-pages/.github/workflows/publish.yml
T

67 lines
2.0 KiB
YAML

name: Publish
on:
release:
types: [published]
permissions:
contents: read
id-token: write
packages: write
env:
MISE_TRUSTED_CONFIG_PATHS: ${{ github.workspace }}/.mise/config.toml
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- id: token
uses: immich-app/devtools/actions/create-workflow-token@df46d635b905e618b88fc4c95baa920aeb30b309 # create-workflow-token-action-v3.0.1
with:
client-id: ${{ secrets.PUSH_O_MATIC_APP_CLIENT_ID }}
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
permission-contents: read
- name: Setup Mise
uses: immich-app/devtools/actions/use-mise@06a9ef925332c91be647d6256642b86b398592c8 # use-mise-action-v3.2.1
with:
github_token: ${{ steps.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: Build packages
run: pnpm build:packages
- name: Find package
id: find-package
env:
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
run: |
PACKAGE_NAME="${RELEASE_TAG_NAME%-*}"
echo "Package is $PACKAGE_NAME"
echo "package_name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT"
- name: Publish
run: pnpm --filter ./packages/${{ steps.find-package.outputs.package_name }} publish --no-git-checks