Skip to content

fix(www): sitemap.xml - correct lang segment position #69

fix(www): sitemap.xml - correct lang segment position

fix(www): sitemap.xml - correct lang segment position #69

Workflow file for this run

name: Deploy to Cloudflare
on:
push:
branches:
- production
- preview
- main
pull_request:
workflow_dispatch:
jobs:
pre_jobs:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
paths_result: ${{ steps.skip_check.outputs.paths_result }}
reason: ${{ steps.skip_check.outputs.reason }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
skip_after_successful_duplicate: 'true'
do_not_skip: '["workflow_dispatch"]'
paths_filter: |
www:
paths:
- 'libs/utils/**'
- 'sites/www/**'
www:
needs: pre_jobs
if: (needs.pre_jobs.outputs.should_skip != 'true' && needs.pre_jobs.outputs.reason != 'paths') || !fromJSON(needs.pre_jobs.outputs.paths_result).www.should_skip
runs-on: ubuntu-latest
environment:
name: |-
${{
github.ref_name == 'production' && 'sveltevietnam (Production)'
|| github.ref_name == 'preview' && 'sveltevietnam (Preview)'
|| 'sveltevietnam (Dev)'
}}
url: |-
${{
github.ref_name == 'production' && 'https://sveltevietnam.dev'
|| github.ref_name == 'preview' && 'https://preview.sveltevietnam.dev'
|| steps.cloudflare-pages-deploy.outputs.url
}}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Get pnpm cache
uses: actions/cache@v3
with:
path: '${{ env.STORE_PATH }}'
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
continue-on-error: false
- name: Build
run: pnpm run build --filter=@sites/www
env:
# cloudflare turnstile
PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY: ${{ vars.PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY }}
CLOUDFLARE_TURNSTILE_SECRET_KEY: ${{ secrets.CLOUDFLARE_TURNSTILE_SECRET_KEY }}
# cookies
COOKIE_USER_ID: ${{ vars.COOKIE_USER_ID }}
PUBLIC_COOKIE_COLOR_SCHEME: ${{ vars.PUBLIC_COOKIE_COLOR_SCHEME }}
COOKIE_LANGUAGE: ${{ vars.COOKIE_LANGUAGE }}
# public env
PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID: ${{ vars.PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID }}
PUBLIC_DISCORD_WS_URL: ${{ vars.PUBLIC_DISCORD_WS_URL }}
PUBLIC_MODE: ${{ vars.PUBLIC_MODE }}
# DKIM for MailChannels
DKIM_DOMAIN: ${{ vars.DKIM_DOMAIN }}
DKIM_SELECTOR: ${{ vars.DKIM_SELECTOR }}
DKIM_PRIVATE_KEY: ${{ secrets.DKIM_PRIVATE_KEY }}
- name: Deploy to Cloudflare
id: cloudflare-pages-deploy
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: sveltevietnam
directory: sites/www/.svelte-kit/cloudflare
# gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
wranglerVersion: "3.4"
- name: Create commit comment
if: ${{ github.event_name == 'push' }}
uses: peter-evans/commit-comment@v2
with:
body: |
## ⚡ Successfully Cloudflare Pages deployed!
| Name | Link |
| :--- | :--- |
| Latest commit | ${{ github.event.pull_request.head.sha || github.sha }} |
| Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| Deploy Preview Url | [${{ steps.cloudflare-pages-deploy.outputs.url }}](${{ steps.cloudflare-pages-deploy.outputs.url }}) |
| Environment | ${{ steps.cloudflare-pages-deploy.outputs.environment }} |
- name: Create PR comment
if: ${{ github.event_name == 'pull_request' }}
uses: mshick/add-pr-comment@v2
with:
message: |
## ⚡ Successfully Cloudflare Pages deployed!
| Name | Link |
| :--- | :--- |
| Latest commit | ${{ github.event.pull_request.head.sha || github.sha }} |
| Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| Deploy Preview Url | [${{ steps.cloudflare-pages-deploy.outputs.url }}](${{ steps.cloudflare-pages-deploy.outputs.url }}) |
| Environment | ${{ steps.cloudflare-pages-deploy.outputs.environment }} |