Skip to content

Commit d02b09c

Browse files
author
hjonin
committed
gh-1 add deployment to preproduction
1 parent 0fc6d71 commit d02b09c

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

.github/workflows/preproduction.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy code.gouv.fr website to preproduction
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
12+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
# Build job
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Build with Eleventy
25+
run: |
26+
npm install
27+
npm run build-preproduction
28+
- uses: actions/upload-artifact@v3
29+
with:
30+
name: site
31+
path: _site/
32+
33+
# Deployment job
34+
deploy:
35+
runs-on: ubuntu-latest
36+
needs: build
37+
steps:
38+
- uses: actions/download-artifact@v3
39+
with:
40+
name: site
41+
path: _site/
42+
- name: Deploy to Server
43+
uses: easingthemes/ssh-deploy@main
44+
env:
45+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
46+
ARGS: "-av --delete"
47+
SOURCE: _site/
48+
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
49+
REMOTE_USER: ${{ secrets.REMOTE_USER }}
50+
TARGET: ${{ secrets.REMOTE_TARGET }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Une base de code pour déployer un site/blog statique avec Eleventy et le DSFR.",
55
"scripts": {
66
"build": "npx @11ty/eleventy",
7-
"build-ghpages": "npx @11ty/eleventy --pathprefix=/eleventy-dsfr/",
7+
"build-preproduction": "npx @11ty/eleventy",
88
"start": "npx @11ty/eleventy --serve --quiet",
99
"debug": "DEBUG=Eleventy* npx @11ty/eleventy",
1010
"debugstart": "DEBUG=Eleventy* npx @11ty/eleventy --serve --quiet",

0 commit comments

Comments
 (0)