Skip to content

Commit

Permalink
chore: update deploy-site workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell committed Sep 21, 2023
1 parent 92a2fed commit d3c3597
Showing 1 changed file with 19 additions and 30 deletions.
49 changes: 19 additions & 30 deletions .github/workflows/deploy-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,29 @@ jobs:
id-token: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Checkout formBuilder
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: kevinchappell/formBuilder
fetch-depth: 1
ref: master

- name: Checkout formBuilder-site
uses: actions/checkout@v3
with:
repository: kevinchappell/formBuilder-site
fetch-depth: 1
ref: master

- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'npm'

- name: Install dependencies
env:
CI: true
run: npm install
- name: Build the plugin
run: npm run build

- name: Get npm package version using jq
if: success()
id: get_version
- name: Update website dependencies
run: |
VERSION=$(jq -r ".version" package.json)
echo "::set-output name=version::$VERSION"
- name: Deploy the website
env:
VERSION: ${{ steps.get_version.outputs.version }}
TOKEN: ${{ secrets.FORMBUILDER_SITE_PAT }}
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git clone https://${TOKEN}@github.com/kevinchappell/formBuilder-site.git
cd formBuilder-site
npm version ${{ env.VERSION }}
# Commit and push the changes
git commit -am "Update site to ${{ env.VERSION }}"
git push https://${TOKEN}@github.com/kevinchappell/formBuilder-site.git master
cd kevinchappell/formBuilder-site
npm update formBuilder formBuilder-languages
npm version $(cd ../formBuilder && node -p "require('./package.json').version")
git push --follow-tags

0 comments on commit d3c3597

Please sign in to comment.