-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(github-actions): add publish workflows to prod (#1732)
* feat(github-actions): add publish workflows to prod * feat(github-actions): update workflows with final branches
- Loading branch information
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: publish (Publish production site) | ||
|
||
on: | ||
push: | ||
branches: | ||
- v1 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish: | ||
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom-website' | ||
runs-on: ubuntu-20.04 | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Build website | ||
run: | | ||
echo "PATH_PREFIX=/standards/carbon/v1" >> .env.production | ||
echo "GATSBY_CPU_COUNT=1" >> .env.production | ||
yarn build | ||
- name: Publish to COS (Carbon for IBM.com Web Components) | ||
uses: jakejarvis/s3-sync-action@master | ||
with: | ||
args: --acl public-read --follow-symlinks | ||
env: | ||
AWS_S3_BUCKET: ${{ secrets.COS_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.COS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.COS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: ${{ secrets.COS_REGION }} | ||
AWS_S3_ENDPOINT: https://${{ secrets.COS_ENDPOINT }} | ||
SOURCE_DIR: 'public' | ||
DEST_DIR: 'standards/carbon/v1' | ||
- uses: act10ns/slack@v2 | ||
with: | ||
status: ${{ job.status }} | ||
if: failure() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: publish-v2 (Publish production site v2) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish: | ||
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom-website' | ||
runs-on: ubuntu-20.04 | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Build website | ||
run: | | ||
echo "PATH_PREFIX=/standards/carbon" >> .env.production | ||
echo "GATSBY_CPU_COUNT=1" >> .env.production | ||
yarn build | ||
- name: Publish to COS (Carbon for IBM.com Web Components) | ||
uses: jakejarvis/s3-sync-action@master | ||
with: | ||
args: --acl public-read --follow-symlinks | ||
env: | ||
AWS_S3_BUCKET: ${{ secrets.COS_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.COS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.COS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: ${{ secrets.COS_REGION }} | ||
AWS_S3_ENDPOINT: https://${{ secrets.COS_ENDPOINT }} | ||
SOURCE_DIR: 'public' | ||
DEST_DIR: 'standards/carbon' | ||
- uses: act10ns/slack@v2 | ||
with: | ||
status: ${{ job.status }} | ||
if: failure() |