mirror of
https://github.com/Redocly/redoc.git
synced 2026-01-23 00:03:50 +03:00
Co-authored-by: Roman Hotsiy <gotsijroman@gmail.com> Co-authored-by: Alex Varchuk <olexandr.varchuk@gmail.com> Co-authored-by: Oprysk Vyacheslav <vyacheslav@redocly.com> Co-authored-by: Ivan Kropyvnytskyi <130547411+ivankropyvnytskyi@users.noreply.github.com> Co-authored-by: Yevhen Pylyp <yevhen.pylyp@redocly.com> Co-authored-by: Vladyslav Makarenko <vladyslav.makarenko@redocly.com> Co-authored-by: Yevhenii Medviediev <yevhenii.medviediev@redocly.com> Co-authored-by: Oleksii Horbachevskyi <oleksii.horbachevskyi@redocly.com> Co-authored-by: volodymyr-rutskyi <rutskyi.v@gmail.com> Co-authored-by: Adam Altman <adam@redoc.ly> Co-authored-by: Andrew Tatomyr <andrew.tatomyr@redocly.com> Co-authored-by: Anastasiia Derymarko <anastasiia@redocly.com> Co-authored-by: Roman Marshevskyy <roman.marshevskyy@redoc.ly> Co-authored-by: Lorna Mitchell <lorna.mitchell@redocly.com> Co-authored-by: Taylor Krusen <taylor.krusen@redocly.com>
90 lines
2.6 KiB
YAML
90 lines
2.6 KiB
YAML
name: Release
|
|
|
|
# permissions:
|
|
# id-token: write
|
|
# contents: read
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
published: ${{ steps.changesets.outputs.published }}
|
|
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: 22.17
|
|
cache: 'npm'
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Create Release Pull Request or Publish to npm
|
|
id: changesets
|
|
uses: RomanHotsiy/changesets-action@v1
|
|
with:
|
|
publish: npm run release
|
|
commit: 'chore: 🔖 release new versions'
|
|
title: 'chore: 🔖 release new versions'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
dockerhub:
|
|
needs: [release]
|
|
if: needs.release.outputs.published == 'true'
|
|
uses: ./.github/workflows/docker.yml
|
|
secrets:
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
publish-cdn:
|
|
name: Publish to CDN
|
|
needs: [release]
|
|
if: needs.release.outputs.published == 'true'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Configure AWS
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
aws-region: us-east-1
|
|
- name: Download all artifact
|
|
uses: actions/download-artifact@v4
|
|
- name: Publish to S3
|
|
run: npm run publish-cdn
|
|
|
|
invalidate-cache:
|
|
name: Clear cache
|
|
runs-on: ubuntu-latest
|
|
needs: [release, publish-cdn]
|
|
if: needs.release.outputs.published == 'true'
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Configure AWS
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
aws-region: us-east-1
|
|
- name: Invalidate cache
|
|
run: ./scripts/clear-cache.sh
|
|
shell: bash
|
|
env:
|
|
DISTRIBUTION: ${{ secrets.DISTRIBUTION }} |