-
-
Notifications
You must be signed in to change notification settings - Fork 16
52 lines (43 loc) · 1.49 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Workflow to build and deploy to your GitHub Pages repo.
# Edit your project details here.
# Remember to add API_TOKEN_GITHUB in repo Settings > Secrets as well!
env:
githubEmail: [email protected]
actorUser: manasky
deployToRepo: lorem.space
name: Github Pages Astro CI
on:
# Triggers the workflow on push and pull request events but only for the main branch
push:
branches: [master]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Install dependencies with npm
- name: Install dependencies
run: npm ci
# Build the project and add .nojekyll file to supress default behaviour
- name: Build
run: |
npm run build
touch ./dist/.nojekyll
# Push to your pages repo
- name: Push to pages repo
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'dist'
destination-repository-username: ${{ env.actorUser }}
destination-repository-name: ${{ env.deployToRepo }}
user-name: ${{ env.actorUser }}
user-email: ${{ env.githubEmail }}
commit-message: Deploy ORIGIN_COMMIT
target-branch: gh-pages