Skip to content

Merge pull request #6 from danswater/vite #5

Merge pull request #6 from danswater/vite

Merge pull request #6 from danswater/vite #5

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install Yarn
run: |
npm install -g yarn
- name: Install Dependencies
run: |
yarn install
- name: Build project
run: |
yarn build
- name: Upload generated template
uses: actions/upload-artifact@v4
id: upload-generated-template
with:
name: template-output
path: dist
- uses: actions/checkout@v4
with:
repository: 'danswater/danswater.github.io'
ref: 'master'
token: ${{ secrets.TEMPLATE_OUTPUT_REPO_TOKEN }}
- name: Download generated template
uses: actions/download-artifact@v4
with:
name: template-output
- name: Setup git config
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "dansisabot.github@gmail.com"
- name: Deploy project
run: |
ls -la
export COMMIT_MESSAGE="Generated template from ${{ github.repository }}/${{ github.ref}}@${{ github.sha }}"
git add .
git commit -m "$COMMIT_MESSAGE"
git push