chore(deps): update dependency wrangler to v3.86.0 #400
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Website Deployment | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
build: | |
name: Build | |
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 | |
outputs: | |
skip: ${{ steps.moon-build.outputs.skip }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: moonrepo/setup-toolchain@abc36a5d744a0b6dff6fd87201c49917c145deb9 # v0.3.1 | |
with: | |
auto-install: true | |
- id: moon-build | |
run: | | |
temp_file=$(mktemp) | |
moon --color --log info ci site:build | tee "$temp_file" | |
if grep -q "No targets to run based on touched files" "$temp_file"; then | |
echo "skip=true" >> $GITHUB_OUTPUT | |
else | |
echo "skip=false" >> $GITHUB_OUTPUT | |
fi | |
rm "$temp_file" | |
env: | |
ASTRO_STUDIO_APP_TOKEN: ${{ secrets.ASTRO_STUDIO_APP_TOKEN }} | |
MOONBASE_SECRET_KEY: ${{ secrets.MOONBASE_SECRET_KEY }} | |
- uses: moonrepo/run-report-action@0e591adc3fbc65a5c9b2f4738368f378c2efaa79 # v1.8.0 | |
if: ${{ steps.moon-build.outputs.skip != 'true' }} | |
with: | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 | |
if: ${{ steps.moon-build.outputs.skip != 'true' }} | |
id: artifact-upload | |
with: | |
# Name of the artifact to upload. | |
# Optional. Default is 'artifact' | |
name: ${{ github.workflow_sha }} | |
# A file, directory or wildcard pattern that describes what to upload | |
# Required. | |
path: apps/site/dist/ | |
# The desired behavior if no files are found using the provided path. | |
# Available Options: | |
# warn: Output a warning but do not fail the action | |
# error: Fail the action with an error message | |
# ignore: Do not output any warnings or errors, the action does not fail | |
# Optional. Default is 'warn' | |
if-no-files-found: warn | |
# Duration after which artifact will expire in days. 0 means using default retention. | |
# Minimum 1 day. | |
# Maximum 90 days unless changed from the repository settings page. | |
# Optional. Defaults to repository settings. | |
retention-days: 1 | |
# The level of compression for Zlib to be applied to the artifact archive. | |
# The value can range from 0 to 9. | |
# For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. | |
# Optional. Default is '6' | |
compression-level: 0 | |
# If true, an artifact with a matching name will be deleted before a new one is uploaded. | |
# If false, the action will fail if an artifact for the given name already exists. | |
# Does not fail if the artifact does not exist. | |
# Optional. Default is 'false' | |
overwrite: true | |
deploy-preview: | |
needs: build | |
if: ${{ github.ref != 'refs/heads/main' && needs.build.outputs.skip != 'true' }} | |
name: Deploy - Preview | |
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: moonrepo/setup-toolchain@abc36a5d744a0b6dff6fd87201c49917c145deb9 # v0.3.1 | |
with: | |
auto-install: true | |
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
id: deployment | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const { default: script } = await import('${{ github.workspace }}/.github/scripts/create-deployment.js') | |
await script({github, context, core}) | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
# Name of the artifact to download. | |
# If unspecified, all artifacts for the run are downloaded. | |
# Optional. | |
name: ${{ github.workflow_sha}} | |
# Destination path. Supports basic tilde expansion. | |
# Optional. Default is $GITHUB_WORKSPACE | |
path: apps/site/dist/ | |
# A glob pattern to the artifacts that should be downloaded. | |
# Ignored if name is specified. | |
# Optional. | |
# pattern: | |
# When multiple artifacts are matched, this changes the behavior of the destination directories. | |
# If true, the downloaded artifacts will be in the same directory specified by path. | |
# If false, the downloaded artifacts will be extracted into individual named directories within the specified path. | |
# Optional. Default is 'false' | |
merge-multiple: true | |
# The GitHub token used to authenticate with the GitHub API. | |
# This is required when downloading artifacts from a different repository or from a different workflow run. | |
# Optional. If unspecified, the action will download artifacts from the current repo and the current workflow run. | |
# github-token: | |
# The repository owner and the repository name joined together by "/". | |
# If github-token is specified, this is the repository that artifacts will be downloaded from. | |
# Optional. Default is ${{ github.repository }} | |
# repository: | |
# The id of the workflow run where the desired download artifact was uploaded from. | |
# If github-token is specified, this is the run that artifacts will be downloaded from. | |
# Optional. Default is ${{ github.run_id }} | |
# run-id: | |
- uses: cloudflare/wrangler-action@a08dc762e87e8754e0d56a16a35a70b406bc869f # v3.6.1 | |
id: wrangler | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
# renovate: datasource=npm depName=wrangler | |
wranglerVersion: "3.68.0" | |
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 { default: script } = await import('${{ github.workspace }}/.github/scripts/update-deployment.js') | |
await script({github, context, core}) | |
deploy-production: | |
if: ${{ github.ref == 'refs/heads/main' && needs.build.outputs.skip != 'true' }} | |
needs: build | |
name: Deploy - Production | |
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: moonrepo/setup-toolchain@abc36a5d744a0b6dff6fd87201c49917c145deb9 # v0.3.1 | |
with: | |
auto-install: true | |
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
id: deployment | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const { default: script } = await import('${{ github.workspace }}/.github/scripts/create-deployment.js') | |
await script({github, context, core}) | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
# Name of the artifact to download. | |
# If unspecified, all artifacts for the run are downloaded. | |
# Optional. | |
name: ${{ github.workflow_sha}} | |
# Destination path. Supports basic tilde expansion. | |
# Optional. Default is $GITHUB_WORKSPACE | |
path: apps/site/dist/ | |
# A glob pattern to the artifacts that should be downloaded. | |
# Ignored if name is specified. | |
# Optional. | |
# pattern: | |
# When multiple artifacts are matched, this changes the behavior of the destination directories. | |
# If true, the downloaded artifacts will be in the same directory specified by path. | |
# If false, the downloaded artifacts will be extracted into individual named directories within the specified path. | |
# Optional. Default is 'false' | |
merge-multiple: true | |
# The GitHub token used to authenticate with the GitHub API. | |
# This is required when downloading artifacts from a different repository or from a different workflow run. | |
# Optional. If unspecified, the action will download artifacts from the current repo and the current workflow run. | |
# github-token: | |
# The repository owner and the repository name joined together by "/". | |
# If github-token is specified, this is the repository that artifacts will be downloaded from. | |
# Optional. Default is ${{ github.repository }} | |
# repository: | |
# The id of the workflow run where the desired download artifact was uploaded from. | |
# If github-token is specified, this is the run that artifacts will be downloaded from. | |
# Optional. Default is ${{ github.run_id }} | |
# run-id: | |
- uses: cloudflare/wrangler-action@a08dc762e87e8754e0d56a16a35a70b406bc869f # v3.6.1 | |
id: wrangler | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
# renovate: datasource=npm depName=wrangler | |
wranglerVersion: "3.68.0" | |
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 { default: script } = await import('${{ github.workspace }}/.github/scripts/update-deployment.js') | |
await script({github, context, core}) |