feat: run release action on main push #1
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: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
check-env: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check is DIPLODOC_STORAGE_BUCKET secret exists" | |
env: | |
storage-bucket: ${{ vars.DIPLODOC_STORAGE_BUCKET }} | |
if: ${{ env.storage-bucket == '' }} | |
run: 'echo "::error:: The variable \"DIPLODOC_STORAGE_BUCKET\" has not been made; please check that all necessary secrets and variables are installed or follow the link https://diplodoc.com/quickstart" && exit 1' | |
build: | |
needs: check-env | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build | |
uses: diplodoc-platform/docs-build-action@v2 | |
with: | |
revision: "${{ github.sha }}" | |
src-root: "./docs" | |
storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} | |
storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} | |
storage-bucket: ${{ vars.DIPLODOC_STORAGE_BUCKET }} | |
storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} | |
storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Release | |
uses: diplodoc-platform/docs-release-action@v2 | |
with: | |
revision: "${{ github.sha }}" | |
storage-bucket: ${{ vars.DIPLODOC_STORAGE_BUCKET }} | |
storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} | |
storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} |