Merge branch 'main' of github.com:cgcostume/portfolio #56
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 website | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy website | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Initialize Node.js environment | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Check out deploy branch | |
uses: actions/checkout@v2 | |
with: | |
ref: deploy | |
path: deploy | |
- name: Clean up output | |
run: git rm -rf * || true | |
working-directory: deploy | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build -- --output-path=./deploy | |
- name: Create CNAME | |
run: echo "daniellimberger.de" > CNAME | |
working-directory: deploy | |
- name: Commit result | |
run: | | |
git config user.email "${{ github.event.pusher.email }}" | |
git config user.name "${{ github.event.pusher.name }}" | |
git add * | |
git diff-index --quiet HEAD || git commit -m "deploy: ${{ github.event.head_commit.message }}" | |
git push | |
working-directory: deploy |