-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (49 loc) · 1.82 KB
/
build.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
name: Preview Build
on:
push:
branches:
- develop
- transifex
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
container:
image: openstandia/keycloak-documentation-i18n:asciidoctor
options: -v ${{ github.workspace }}:/build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
separator: ","
files: translations/**
- name: Build documents
run: |
apt-get update && apt-get install -y bc
/build/build.sh ${{ steps.changed-files.outputs.all_changed_files }}
- name: Configure AWS credentials from IAM Role
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::898353857660:role/keycloak-documentation-i18n-github-action
aws-region: ap-northeast-1
- name: Sync to s3
run: |
aws s3 cp ./site/preview.html s3://keycloak-documentation/preview/index.html
aws s3 cp ./site/keycloak_logo.png s3://keycloak-documentation/preview/
aws s3 cp ./site/openstandia_logo.png s3://keycloak-documentation/preview/
for language in `ls ./translations | sed "s|/||"`; do
for version in `ls ./dist | sed "s|/||"`; do
if [ -d ./dist/$version/$language ]; then
echo "Sync $version/$language to S3 release dir"
aws s3 sync ./dist/$version/$language s3://keycloak-documentation/preview/$version/$language --delete
fi
done
done