deps: update actions/cache action to v3.3.3 #214
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: Pull Request | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- next | |
env: | |
CI: 1 | |
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true | |
DOCKER_BUILDKIT: 1 | |
jobs: | |
linting: | |
name: Linting | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3.0.2 | |
- uses: ./.github/actions/setup-env | |
- name: ESLint | |
run: yarn eslint --format junit --output-file artifacts/eslint.junit.xml . | |
- name: TypeScript Type Check | |
run: yarn workspaces foreach -v --no-private run lint:typecheck | |
# - name: Terraform Linting | |
# run: yarn workspace sanity-runner-terraform lint | |
build: | |
name: Build | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
needs: [linting] | |
steps: | |
- uses: actions/checkout@v3.0.2 | |
- uses: ./.github/actions/setup-env | |
- name: Build Packages | |
run: yarn workspaces foreach -vpt --no-private --topological-dev run prepack | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker Images | |
run: yarn workspaces foreach -vpt --no-private --topological-dev run docker:build | |
dry_release: | |
name: Dry Release | |
if: github.event_name == 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]') | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v3.0.2 | |
with: | |
token: ${{ secrets.TOPHAT_BOT_GH_TOKEN }} | |
fetch-depth: 0 | |
- uses: ./.github/actions/setup-env | |
- name: Prerelease (Dry) | |
if: github.base_ref == 'next' | |
run: yarn prerelease:dry --git-base-branch origin/${{ github.base_ref }} | |
- name: Release (Dry) | |
if: github.base_ref != 'next' | |
run: yarn release:dry --git-base-branch origin/${{ github.base_ref }} | |
- name: Parse Changelog | |
continue-on-error: true | |
run: | | |
changelog_body=$(cat artifacts/CHANGELOG.md) | |
changelog_body="${changelog_body//'%'/'%25'}" | |
changelog_body="${changelog_body//$'\n'/'%0A'}" | |
changelog_body="${changelog_body//$'\r'/'%0D'}" | |
echo ::set-output name=changelog::$changelog_body | |
id: dry-release | |
- name: Check for Changelog Comment | |
uses: peter-evans/find-comment@v1 | |
id: found-comment | |
if: github.event_name == 'pull_request' && steps.dry-release.outcome == 'success' | |
with: | |
token: ${{ secrets.TOPHAT_BOT_GH_TOKEN }} | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'tophat-opensource-bot' | |
body-includes: <!-- MONODEPLOY_CHANGELOG_PREVIEW --> | |
- name: Post Changelog to PR | |
uses: peter-evans/create-or-update-comment@v1 | |
if: github.event_name == 'pull_request' && steps.dry-release.outcome == 'success' | |
with: | |
token: ${{ secrets.TOPHAT_BOT_GH_TOKEN }} | |
comment-id: ${{ steps.found-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
edit-mode: replace | |
body: | | |
<!-- MONODEPLOY_CHANGELOG_PREVIEW --> | |
# Sanity Runner Publish Preview | |
This Pull Request introduces the following changes: | |
${{ steps.dry-release.outputs.changelog }} | |
website: | |
name: Website | |
runs-on: ubuntu-20.04 | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
needs: [linting, build] | |
steps: | |
- uses: actions/checkout@v3.0.2 | |
with: | |
token: ${{ secrets.TOPHAT_BOT_GH_TOKEN }} | |
fetch-depth: 0 | |
- uses: ./.github/actions/setup-env | |
with: | |
node-version: lts/hydrogen | |
- name: Build Website | |
if: "github.event_name == 'pull_request'" | |
run: yarn docs | |
- name: Build & Deploy Website | |
if: "github.event_name == 'push' && github.ref == 'refs/heads/main'" | |
run: | | |
git checkout gh-pages | |
git reset --hard main | |
yarn docs | |
git add docs | |
git commit -m "chore: update website" -n | |
git push --force origin gh-pages |