Merge pull request #8 from BakaFT/typo #32
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
on: | |
push: | |
branches: | |
- main | |
- dev | |
workflow_dispatch: | |
jobs: | |
env-prod: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
url: https://pengu.lol | |
steps: | |
- run: echo >nul | |
env-dev: | |
if: github.ref == 'refs/heads/dev' | |
runs-on: ubuntu-latest | |
environment: | |
name: development | |
url: https://beta.pengu.lol | |
steps: | |
- run: echo >nul | |
deploy: | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set environment variables | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
echo "DENO_DEPLOY_PROJECT=pengu-docs" >> $GITHUB_ENV | |
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then | |
echo "DENO_DEPLOY_PROJECT=pengu-docs-dev" >> $GITHUB_ENV | |
fi | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: 1.x | |
- name: Install Deno deployctl | |
run: deno install --allow-read --allow-write --allow-env --allow-net --allow-run --no-check -r -f https://deno.land/x/deploy/deployctl.ts | |
- name: Build project | |
run: | | |
npm i -g pnpm | |
pnpm install | |
pnpm build | |
- name: Deploy to Deno Deploy | |
run: | | |
cd .vitepress | |
deployctl deploy --prod --project=$DENO_DEPLOY_PROJECT ./serve.ts --token ${{ secrets.DENO_DEPLOY_TOKEN }} |