Improve labels #1468
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: phoenix-ci | |
on: [pull_request, workflow_dispatch] | |
jobs: | |
build-and-test: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@main | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup | |
run: yarn install | |
- name: Lint | |
run: yarn lint | |
- name: Test | |
run: yarn test:ci | |
- name: Documentation Coverage | |
run: yarn docs:coverage | |
- name: Code Coverage | |
uses: coverallsapp/github-action@master | |
with: | |
base-path: ./packages/phoenix-event-display | |
path-to-lcov: ./packages/phoenix-event-display/coverage/lcov.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pre Deploy Pull Request | |
uses: jwalton/gh-find-current-pr@master | |
id: if_pr | |
- name: Deploy | |
id: deploy | |
if: ${{ steps.if_pr.outputs.number || github.ref == 'refs/heads/main' }} | |
env: | |
PR_URL: http://phoenix-pr-${{ steps.if_pr.outputs.number }}.surge.sh | |
DEV_URL: http://phoenix-dev.surge.sh | |
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} | |
run: | | |
yarn deploy:web | |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then | |
export DEPLOYMENT_URL=$DEV_URL | |
export DEPLOYMENT_ENV=dev | |
else | |
export DEPLOYMENT_URL=$PR_URL | |
export DEPLOYMENT_ENV=pull-request | |
fi | |
npx surge --project ./packages/phoenix-ng/docs/ --domain $DEPLOYMENT_URL | |
echo "::set-output name=deployment_url::$DEPLOYMENT_URL" | |
echo "::set-output name=deployment_env::$DEPLOYMENT_ENV" | |
- name: Create Deployment | |
id: create_deployment | |
if: ${{ success() && (steps.if_pr.outputs.number || github.ref == 'refs/heads/main') }} | |
uses: octokit/request-action@v2.x | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
route: POST /repos/{repository}/deployments | |
repository: ${{ github.repository }} | |
ref: ${{ github.ref }} | |
environment: ${{ steps.deploy.outputs.deployment_env }} | |
required_contexts: '[]' | |
auto_merge: false | |
- name: Create Deployment Status | |
if: ${{ success() && (steps.if_pr.outputs.number || github.ref == 'refs/heads/main') }} | |
uses: octokit/request-action@v2.x | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
route: POST /repos/{repository}/deployments/{deployment_id}/statuses | |
repository: ${{ github.repository }} | |
deployment_id: ${{ fromJSON(steps.create_deployment.outputs.data).id }} | |
state: success | |
target_url: ${{ steps.deploy.outputs.deployment_url }} | |
description: Deployed to environment ${{ steps.deploy.outputs.deployment_env }} | |
environment: ${{ steps.deploy.outputs.deployment_env }} | |
environment_url: ${{ steps.deploy.outputs.deployment_url }} | |
mediaType: '{ "previews": ["flash", "ant-man"] }' |