deploy #1134
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
name: deploy | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
tools: composer:v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Install Composer Dependencies | |
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist | |
- name: Install Yarn Dependencies | |
run: | | |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/ | |
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_TOKEN }} | |
yarn install | |
- name: Mix assets | |
run: yarn build | |
- name: Export page | |
run: | | |
php artisan blade-fontawesome:sync-icons | |
php artisan icons:cache | |
php artisan export --env=prod --skip-all | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
IMGIX_SIGN_KEY: ${{ secrets.IMGIX_SIGN_KEY }} | |
- name: Netlify deploy | |
run: | | |
yarn global add netlify-cli | |
"$(yarn global bin)/netlify" deploy --prod | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
- name: Upload Log | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: laravel.log | |
path: storage/logs/laravel.log |