generated from cotes2020/chirpy-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 1.95 KB
/
deploy.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Deploy"
on:
push:
branches:
- main
- master
paths-ignore:
- .gitignore
- README.md
- LICENSE
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read # permits an action to list the commits (unsure if necessary for us)
# Only one deploy.yml file can run at the same time
concurrency:
group: "deployment"
cancel-in-progress: true
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # for posts's lastmod
# submodules: true
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1 # reads from a '.ruby-version' or '.tools-version' file if 'ruby-version' is omitted
bundler-cache: true
# TODO: Don't duplicate building the site again?
# TOOD: If we have to duplicate, reference the job/steps from build.yml
- name: Build site
run: |
bundle exec jekyll b
env:
JEKYLL_ENV: "production"
- name: Deploy to mattpopovich.com
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.HOSTNAME }}
REMOTE_USER: ${{ secrets.USERNAME }}
ARGS: "-ahv --delete"
SOURCE: "_site/"
TARGET: ${{ secrets.SERVER_DESTINATION }}
SCRIPT_BEFORE: |
whoami
ls -lah
SCRIPT_AFTER: |
whoami
ls -lah
ls -lah mattpopovich.com
# run: |
# rsync -ahv --delete --dry-run ${{ steps.pages.outputs.base_path }} ${{ secrets.USERNAME }}@${{ secrets.HOSTNAME }}:${{ secrets.SERVER_DESTINATION}}