Skip to content

deploy-canary

deploy-canary #1100

Workflow file for this run

name: deploy-canary (Deploy to Github Pages)
on:
push:
branches:
- main
repository_dispatch:
types: [deploy-canary]
concurrency:
group: deploy-canary-${{ github.ref }}
cancel-in-progress: true
jobs:
canary:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom-web-components-test'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
token: ${{secrets.BOT_TOKEN}}
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Install dependencies
run: yarn install
- name: Grab latest canary release
run: yarn update-canary
- name: Set env vars
uses: ./.github/actions/set-dotenv
with:
env-file: .env
- name: Build project
run: yarn build
- name: Deploying to Github Pages
run: |
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
git checkout -- package.json
git checkout -- yarn.lock
git fetch origin gh-pages
git checkout -b gh-pages origin/gh-pages
git update-ref -d refs/remotes/origin/gh-pages
git pull origin gh-pages
rm -rf canary
mkdir -p canary
mv dist/* canary
git add canary
git commit -m "chore(deploy): deploy canary to GitHub Pages"
git push origin gh-pages
- name: Notify Slack upon failure
uses: act10ns/slack@v1
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
canary-rtl:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom-web-components-test'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
token: ${{secrets.BOT_TOKEN}}
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Install dependencies
run: yarn install
- name: Grab latest canary release
run: yarn update-canary
- name: Set env vars
uses: ./.github/actions/set-dotenv
with:
env-file: .env
env:
ENABLE_RTL: true
- name: Build project
run: yarn build
- name: Deploying to Github Pages
run: |
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
git checkout -- package.json
git checkout -- yarn.lock
git fetch origin gh-pages
git checkout -b gh-pages origin/gh-pages
git update-ref -d refs/remotes/origin/gh-pages
git pull origin gh-pages
rm -rf canary-rtl
mkdir -p canary-rtl
mv dist/* canary-rtl
git add canary-rtl
git commit -m "chore(deploy): deploy canary (RTL) to GitHub Pages"
git push origin gh-pages
- name: Notify Slack upon failure
uses: act10ns/slack@v1
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}