-
-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (31 loc) · 982 Bytes
/
publish.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
name: Publish
on: [push, pull_request]
jobs:
build:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Build
run: |
scripts/build.sh
- name: Proofing
run: scripts/test.sh
- name: Deploy
if: ${{ github.event_name == 'push' && github.repository == 'polychromatic/website' && github.ref == 'refs/heads/master' }}
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
run: |
sudo apt-get install rsync
mkdir -p $HOME/.ssh/
chmod 700 $HOME/.ssh/
echo -n "${{ secrets.SSH_CONFIG }}" > $HOME/.ssh/config
echo -n "${{ secrets.SSH_KEY }}" > $HOME/.ssh/id_rsa
echo -n "${{ secrets.SSH_KNOWN_HOSTS }}" > $HOME/.ssh/known_hosts
chmod 600 $HOME/.ssh/id_rsa
scripts/deploy.sh