feat: create env file with build #3
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
# Simple workflow for deploying static content to GitHub Pages | |
name: Deploy static content to server | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ['main', 'dev'] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Make envfile | |
uses: SpicyPizza/[email protected] | |
with: | |
envkey_VITE_API_URL: 'https://lafresca-api.ucsc.eu.org/api/lafresca' | |
envkey_VITE_UPLOAD_URL: ${{ secrets.UPLOAD_URL }} | |
envkey_COOKIE_PROTOCOL: 'https:' | |
file_name: .env | |
- name: Upload artifact | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: ${{ secrets.PORT }} | |
source: './dist, .env' | |
target: '/var/www/lafresca-frontend/html' | |
rm: true |