use oss traffic manager #311
This file contains hidden or 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: "Publish affected apps" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Run all Verifications/Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: Extract node version from package.json | |
uses: sergeysova/jq-action@v2 | |
id: node_version | |
with: | |
cmd: jq .engines.node package.json -r | sed -e 's/"//g' | sed -e 's/>=//g' | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ steps.node_version.outputs.value }}" | |
- name: Use Yarn | |
run: corepack enable | |
- name: Install deps | |
run: yarn | |
- name: Run all tests | |
run: yarn run test/all | |
- name: Coverage | |
if: always() | |
run: yarn run test/coverage/all | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODE_COV_TOKEN }} | |
publish: | |
name: Package and publish affected apps | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: | |
- test | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: Extract node version from package.json | |
uses: sergeysova/jq-action@v2 | |
id: node_version | |
with: | |
cmd: jq .engines.node package.json -r | sed -e 's/"//g' | sed -e 's/>=//g' | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ steps.node_version.outputs.value }}" | |
- name: Use Yarn | |
run: corepack enable | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Install deps | |
run: yarn | |
- name: Publish affected apps | |
run: yarn nx affected --target=publish --parallel --base=HEAD~ --head=HEAD --verbose --exclude=backups | |
env: | |
GITHUB_USERNAME: ${{ github.actor }} | |
NODE_ENV: production | |
CI: "true" |