vality.dev/.github/workflows/main.yml
2022-12-19 19:09:15 +06:00

68 lines
1.5 KiB
YAML

name: Deploy
on:
push:
branches: ['master', 'main', 'epic/**']
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: npm
- name: Setup Pages
id: pages
uses: actions/configure-pages@v2
with:
# Automatically inject pathPrefix in your Gatsby configuration file.
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: gatsby
- name: Restore cache
uses: actions/cache@v3
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-${{ hashFiles('public') }}
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: Install dependencies
run: npm ci
- name: Build with Gatsby
env:
PREFIX_PATHS: 'true'
run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1