Skip to content

[next] applies branding #17

[next] applies branding

[next] applies branding #17

Workflow file for this run

name: preview [cloudflare]
on:
pull_request:
# Sequence of patterns matched against refs/heads
branches:
- main
jobs:
site:
runs-on: ubuntu-latest
permissions:
actions: read
checks: read
contents: read
deployments: write
issues: write
discussions: read
packages: read
pages: read
pull-requests: write
repository-projects: read
security-events: read
statuses: read
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: moonrepo/setup-toolchain@abc36a5d744a0b6dff6fd87201c49917c145deb9 # v0.3.1
id: build
with:
auto-install: true
- run: |
moon --color --log info ci site:build
env:
ASTRO_STUDIO_APP_TOKEN: ${{ secrets.ASTRO_STUDIO_APP_TOKEN }}
# MOONBASE_SECRET_KEY: ${{ secrets.MOONBASE_SECRET_KEY }}
- uses: moonrepo/run-report-action@a92e881fd7c6bd680f64bfa1219ac7ddf3c3d009 # v1.6.1
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: deployment
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const script = require('./.github/scripts/test.js')
script({github, context, core})
# - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
# id: deployment
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# const githubBranch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME;
# const productionEnvironment = githubBranch === 'main';
# const environmentName = `[site] (${productionEnvironment ? "Production" : githubBranch})`;
# const deployment = github.rest.repos.createDeployment({
# owner: context.repo.owner,
# repo: context.repo.repo,
# ref: githubBranch || context.ref,
# auto_merge: false,
# description: "Site Cloudflare Pages",
# required_contexts: [],
# environment: environmentName,
# production_environment: productionEnvironment,
# });
# core.setOutput("deployment-id", deployment.data.id)
# - uses: cloudflare/wrangler-action@7c01cc48d88a1f83b4716e0557c168854a9dcdb8 # v3.4.1
# id: wrangler
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# wranglerVersion: "3.34.2"
# workingDirectory: "apps/site"
# packageManager: pnpm
# command: pages deploy dist --project-name astrolicious
# - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
# env:
# DEPLOYMENT_ID: ${{ steps.deployment.outputs.deployment-id }}
# DEPLOYMENT_URL: ${{ steps.wrangler.outputs.deployment-url }}
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# const githubBranch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME;
# const productionEnvironment = githubBranch === 'main';
# const environmentName = `[site] (${productionEnvironment ? "Production" : ${githubBranch}})`;
# const deployment = github.rest.repos.createDeployment({
# owner: context.repo.owner,
# repo: context.repo.repo,
# deployment_id: process.env.DEPLOYMENT_ID,
# environment: environmentName,
# environment_url: process.env.DEPLOYMENT_URL,
# production_environment: productionEnvironment,
# description: "Cloudflare Pages",
# state: "success",
# auto_inactive: false,
# });