Skip to content

Commit

Permalink
[CI] Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
redstonekasi committed Jul 17, 2023
1 parent c71a9a2 commit dbc81f5
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and push
on:
push:
branches: [master]
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install dependencies
run: pnpm i

- name: Build
run: pnpm run build

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*

push:
name: Push to branch
runs-on: ubuntu-latest
needs: build

permissions:
contents: write

steps:
- uses: actions/checkout@v3
with:
ref: builds

- name: Cleanup
run: git rm -r . || git rm -r * || true

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: "."

- name: Commit files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Build $GITHUB_SHA" || exit 0
git push

0 comments on commit dbc81f5

Please sign in to comment.