forked from iotaledger/identity.rs
-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (46 loc) · 1.6 KB
/
upload-docs.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
name: Build and upload API docs
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to publish docs under (e.g. `v1.2.3-dev.1`)'
required: true
permissions:
actions: 'write'
jobs:
build-wasm:
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@main
with:
run-unit-tests: false
ref: ${{ inputs.ref }}
output-artifact-name: identity-docs
upload-docs:
runs-on: ubuntu-latest
needs: build-wasm
steps:
- uses: actions/download-artifact@v4
with:
name: identity-docs
- name: Get release version
id: get_release_version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
INPUT_VERSION="${{ github.ref }}"
else
INPUT_VERSION="${{ github.event.inputs.version }}"
fi
VERSION=$(echo $INPUT_VERSION | sed -e 's/.*v\([0-9]*\.[0-9]*\).*/\1/')
echo VERSION=$VERSION >> $GITHUB_OUTPUT
- name: Compress generated docs
run: |
tar czvf wasm.tar.gz docs/*
- name: Upload docs to AWS S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IOTA_WIKI }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IOTA_WIKI }}
AWS_DEFAULT_REGION: "eu-central-1"
run: |
aws s3 cp wasm.tar.gz s3://files.iota.org/iota-wiki/iota-identity/${{ steps.get_release_version.outputs.VERSION }}/ --acl public-read