Github Pages Astro CI #86
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: Github Pages Astro CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
schedule: | |
- cron: "30 21 * * *" # every day at 21:30 UTC (= 22:30 CET) | |
jobs: | |
combined-workflow: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
# Install dependencies with npm | |
- name: Install dependencies | |
working-directory: frontend/ | |
run: npm ci | |
# Build the project and add .nojekyll file to supress default behaviour | |
- name: Build frontend | |
working-directory: frontend/ | |
env: | |
KB_EMAIL: ${{ secrets.KB_EMAIL }} | |
KB_PW: ${{ secrets.KB_PW }} | |
KB_LEAGUE_ID: ${{ secrets.KB_LEAGUE_ID }} | |
run: | | |
npm run build | |
ls -la | |
# Push to your pages repo | |
- name: Deploy frontend | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: 'frontend/dist' | |
destination-github-username: 'senoramarillo' | |
destination-repository-name: 'kickbase-information' | |
user-email: 'github-actions[bot]@users.noreply.github.com' | |
target-branch: gh-pages |