-
Notifications
You must be signed in to change notification settings - Fork 39
67 lines (62 loc) · 2.02 KB
/
Copy pathdeploy.yaml
File metadata and controls
67 lines (62 loc) · 2.02 KB
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 to production
on:
push:
branches:
- 'master'
concurrency:
group: production
cancel-in-progress: false
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
container: quay.io/hypernode/deploy:latest-php8.4-node22
steps:
- uses: actions/checkout@v4
with:
# updated_at.py reads the git log to render per-page timestamps.
fetch-depth: 0
- name: Add repository to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Set env for production build
run: |
echo "DOCS_BASE_URL=https://docs.hypernode.com/" >> $GITHUB_ENV
echo "DOCS_INDEX_FOLLOW=1" >> $GITHUB_ENV
# The prepare:ssh task fails on an empty ssh-agent, but building needs no
# server access, so satisfy it with a key that grants access to nothing.
- name: Generate a throwaway SSH key for the build
run: mkdir -p ~/.ssh && ssh-keygen -t ed25519 -N '' -q -f ~/.ssh/id_ed25519
- run: hypernode-deploy build -vvv
- name: archive production artifacts
uses: actions/upload-artifact@v4
with:
name: deployment-build
path: build/build.tgz
retention-days: 5
deploy_production:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 30
environment:
name: production
url: https://docs.hypernode.com
permissions:
contents: read
container: quay.io/hypernode/deploy:latest-php8.4-node22
steps:
- uses: actions/checkout@v4
- name: download build artifact
uses: actions/download-artifact@v4
with:
name: deployment-build
path: build/
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: mkdir -p $HOME/.ssh
- name: deploy to production
run: hypernode-deploy deploy production -vvv