Skip to content

Commit

Permalink
yaml 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hekx11 committed Nov 9, 2023
1 parent c2e7295 commit ad71dfd
Showing 1 changed file with 39 additions and 20 deletions.
59 changes: 39 additions & 20 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
name: Deploy to GitHub Pages
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
build-and-deploy:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14

node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm install

- name: Set up environment variables
run: |
echo "VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }}" >> .env.production
Expand All @@ -33,13 +49,16 @@ jobs:
echo "VITE_FIREBASE_MEASUREMENT_ID=${{ secrets.VITE_FIREBASE_MEASUREMENT_ID }}" >> .env.production
echo "VITE_GOOGLE_MAP_API_KEY=${{ secrets.VITE_GOOGLE_MAP_API_KEY }}" >> .env.production
shell: bash

- name: Build
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: './dist'
- name: Deploy to GitHub Pages
run: |
npm install -g gh-pages
gh-pages -d dist -b gh-pages
env:
NODE_ENV: production
id: deployment
uses: actions/deploy-pages@v1
NODE_ENV: production

0 comments on commit ad71dfd

Please sign in to comment.