GitHub Actions
It's possible to export and deploy static pages via GitHub Actions. Below is an example workflow file which deploys to Netlify. This workflow requires two GitHub Action Secrets you should add to your repository (NETLIFY_AUTH_TOKEN, NETLIFY_SITE_ID) more details in the netlify/actions repo.
.github/workflows/deploy.yml
1
name: Deploy
2
​
3
on:
4
push:
5
branches:
6
- master
7
​
8
jobs:
9
deploy:
10
runs-on: ubuntu-latest
11
steps:
12
- name: Git checkout
13
uses: actions/[email protected]
14
- name: Copy .env
15
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
16
- name: Install Composer Dependencies
17
run: composer install --no-ansi --no-interaction --no-suggest --no-progress --prefer-dist
18
- name: Install Yarn Dependencies
19
run: yarn install
20
- name: Generate key
21
run: php artisan key:generate
22
- name: Mix assets
23
run: yarn production
24
- name: Export page
25
run: php artisan export --env=prod --skip-assets --skip-deploy
26
- name: Netlify deploy
27
uses: netlify/actions/[email protected]
28
with:
29
args: deploy --prod
30
env:
31
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
32
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
Copied!
You should adjust it to your needs if you require any custom commands to be able to export your page.
Last modified 2yr ago
Copy link