Skip to content

Commit

Permalink
Try different Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
luandro committed Sep 4, 2024
1 parent 9abf63c commit d95c96a
Showing 1 changed file with 23 additions and 45 deletions.
68 changes: 23 additions & 45 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,35 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
name: Deploy to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
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
branches:
- main

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
build-and-deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version: '20'

- name: Install dependencies
run: npm ci
- name: Print environment variables
run: |
echo "GITHUB_ACTIONS: $GITHUB_ACTIONS"
echo "NODE_ENV: $NODE_ENV"
echo "Other environment variables:"
env
- name: Build
run: npm install

- name: Build the project
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: './dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages

0 comments on commit d95c96a

Please sign in to comment.