Build and deploy #138
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: Build and deploy | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: "0 8 1 * *" | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.3.1 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install and build frontend | |
env: | |
VUE_APP_MAPBOX_TOKEN: "${{ secrets.VUE_APP_MAPBOX_TOKEN }}" | |
VUE_APP_MAPBOX_STYLE_URL: "${{ secrets.VUE_APP_MAPBOX_STYLE_URL }}" | |
run: | | |
npm install | |
npm run-script build | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
coverage: none | |
- name: Install and build backend | |
run: | | |
composer install | |
echo 'VUE_APP_MAPBOX_TOKEN="${{ secrets.VUE_APP_MAPBOX_TOKEN }}"' > .env | |
composer build | |
- name: Handle 404 for GitHub Pages | |
run: cp index.html 404.html | |
working-directory: public | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@4.1.4 | |
with: | |
BRANCH: public | |
FOLDER: public | |
CLEAN: true |