Skip to content

Merge pull request #9 from BakaFT/dev #33

Merge pull request #9 from BakaFT/dev

Merge pull request #9 from BakaFT/dev #33

Workflow file for this run

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 }}