Skip to content

fix: add env

fix: add env #2

Workflow file for this run

name: Publish to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
NEXT_PUBLIC_SANITY_API_VERSION: ${{ env.NEXT_PUBLIC_SANITY_API_VERSION }}

Check failure on line 18 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / Publish to GitHub Pages

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yml (Line: 18, Col: 35): Unrecognized named-value: 'env'. Located at position 1 within expression: env.NEXT_PUBLIC_SANITY_API_VERSION .github/workflows/publish.yml (Line: 19, Col: 31): Unrecognized named-value: 'env'. Located at position 1 within expression: env.NEXT_PUBLIC_SANITY_DATASET
NEXT_PUBLIC_SANITY_DATASET: ${{ env.NEXT_PUBLIC_SANITY_DATASET }}
NEXT_PUBLIC_SANITY_PROJECT_ID: ${{ env.NEXT_PUBLIC_SANITY_PROJECT_ID }}
GTM_ID: ${{ secret.GTM_ID }}
SANITY_GRAPHQL_ENDPOINT: ${{ secret.SANITY_GRAPHQL_ENDPOINT }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Setup Pages
uses: actions/configure-pages@v4
with:
static_site_generator: next
- name: Build
run: npx next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Publish to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4