Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Set environment = Production on github actions #17

Set environment = Production on github actions

Set environment = Production on github actions #17

Workflow file for this run

name: Deploy
on:
push:
branches: main
pull_request:
branches: main
jobs:
deploy-to-deno:
name: Deploy to Deno
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install step
run: 'npm install'
- name: Create .env.production
run: |
echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > .env.production
- name: Build step
run: 'npm run build'
- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: 'nassport'
entrypoint: 'https://deno.land/[email protected]/http/file_server.ts'
root: 'dist'
# deploy-to-github-pages:
# name: Deploy to GitHub Pages.
# runs-on: ubuntu-latest
# needs: deploy-to-deno # Ensures Deno Deploy finishes first
# steps:
# - name: Clone repository
# uses: actions/checkout@v4
# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version: lts/*
# - name: Install dependencies
# run: npm install
# - name: Build project
# run: npm run build
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./dist
# publish_branch: gh-pages # Ensure it's pushing to the correct branch
# force_orphan: true # Ensure it overwrites the previous deployment.