fix: bash syntax #37
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: Build and Deploy | |
on: | |
push: | |
branches: ["slave"] | |
pull_request: | |
branches: ["slave"] | |
jobs: | |
deploy: | |
environment: github-pages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build:canary | |
- name: Read Build Timestamped Env from .env FILE generated | |
run: | | |
DATEMODIFIED_CODE_DEPLOYMENT=$(cat .env | grep "DATEMODIFIED_CODE_DEPLOYMENT" | cut -d '=' -f2) | |
- name: deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.DEPLOY_KEY }} | |
publish_dir: ./build | |
env: | |
DATEMODIFIED_CODE_DEPLOYMENT: ${{ env.DATEMODIFIED_CODE_DEPLOYMENT }} | |
alert_code_change: | |
runs-on: ubuntu-latest | |
needs: [deploy] | |
environment: github-pages | |
if: github.event_name == 'push' || github.event_name == 'pull_request' | |
steps: | |
- name: Emit repository_dispatch event to canary heartbeat | |
uses: mvasigh/dispatch-action@main | |
with: | |
# You should create a personal access token and store it in your repository | |
token: ${{ secrets.LICENSE_TO_DISPATCH_NOTIFY }} | |
repo: react-adobe-embed-cd-canary | |
owner: ZIPING-LIU-CORPORATION | |
event_type: react_adobe_embed_code_pushed | |
message: | | |
{ | |
"DATEMODIFIED_CODE_DEPLOYED" : ${{ env.DATEMODIFIED_CODE_DEPLOYMENT }} | |
} |