archive #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: archive | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set up Node | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install --frozen-lockfile | |
- name: Redirect pp and cloud links to last documentation | |
run: | | |
find versioned_docs versioned_sidebars -regex ".*\.\(md\|json\)" | xargs --delimiter='\n' sed -i 's#/cloud/#https://docs.centreon.com/cloud/#g' | |
find versioned_docs versioned_sidebars -regex ".*\.\(md\|json\)" | xargs --delimiter='\n' sed -i 's#/pp/#https://docs.centreon.com/pp/#g' | |
shell: bash | |
- name: Build documentation for ${{ github.event.inputs.version }} | |
run: ARCHIVED_VERSION="${{ github.event.inputs.version }}" yarn build | |
- name: Store build archived doc in cache | |
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
with: | |
path: "./build" | |
key: "${{ github.sha }}-${{ github.run_id }}-build-archived-doc" | |
publish: | |
needs: [build] | |
runs-on: [self-hosted, infra] | |
steps: | |
- name: Restore built archived doc from cache | |
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
with: | |
path: "./build" | |
key: "${{ github.sha }}-${{ github.run_id }}-build-archived-doc" | |
fail-on-cache-miss: true | |
- name: Setup awscli | |
run: | | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
sudo unzip -q awscliv2.zip | |
sudo ./aws/install | |
shell: bash | |
# - name: Copy to S3 | |
# run: aws s3 sync --delete "build/" s3://centreon-documentation-archive/${{ github.event.inputs.version }}/ |