-
Notifications
You must be signed in to change notification settings - Fork 17
52 lines (50 loc) · 1.79 KB
/
adoc-build-push_s3.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
name: Build Contents with Asciidoctor then Upload to S3
on:
push:
paths:
- 'docs/**'
workflow_dispatch:
jobs:
asciidoc-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: copy image files
run: |
mkdir -p ./dist/docs
find docs -iname '*.jpg' -exec cp --parents {} ./dist/ \;
find docs -iname '*.png' -exec cp --parents {} ./dist/ \;
find docs -iname '*.svg' -exec cp --parents {} ./dist/ \;
ls ./dist/docs/
working-directory: .
- name: Asciidoctor HTML build
id: asciidoc-html-build
uses: avattathil/asciidoctor-action@master
with:
program: "asciidoctor -D dist/docs -R docs '**/*.adoc' -d book"
- name: Asciidoctor PDF build
id: asciidoc-pdf-build
uses: avattathil/asciidoctor-action@master
with:
program: "asciidoctor-pdf --out-file dist/docs/continuous-architecture.pdf docs/index.adoc"
- name: List generated files
run:
find ./dist/docs
working-directory: .
- name: Copy to S3
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: 'dist/docs'
destination_dir: 'docs'
- name: Invalidate Cloudfront distribution
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION }}
PATHS: '/docs/*'
AWS_REGION: 'eu-west-3'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}