Skip to content

Commit

Permalink
Added example github action
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinByrne committed Jul 30, 2021
1 parent ee8973e commit 4f0eb20
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/main.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI/CD workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
building:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install NPM dependencies
run: npm install
- name: Compile assets
run: npm run build
deploy:
needs: building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: GHPages
- name: Reset production branch
run: |
git fetch origin main:main
git rebase main -s ours
- name: Compile assets
run: |
npm install
npm run build
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Updated assets" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: GHPages
force: true

0 comments on commit 4f0eb20

Please sign in to comment.