-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92a2fed
commit a82d3d6
Showing
1 changed file
with
27 additions
and
33 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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name: Deploy Website | ||
|
||
on: | ||
push: | ||
branches: | ||
- deploy | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -19,40 +19,34 @@ jobs: | |
id-token: write | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout formBuilder | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
env: | ||
CI: true | ||
run: npm install | ||
- name: Build the plugin | ||
run: npm run build | ||
repository: kevinchappell/formBuilder | ||
fetch-depth: 1 | ||
ref: master | ||
path: formBuilder | ||
|
||
- name: Get npm package version using jq | ||
if: success() | ||
id: get_version | ||
- name: Extract version from FormBuilder's package.json | ||
id: get-version | ||
run: | | ||
VERSION=$(jq -r ".version" package.json) | ||
VERSION=$(jq -r .version formBuilder/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 "[email protected]" | ||
- name: Checkout formBuilder-site | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kevinchappell/formBuilder-site | ||
path: formBuilder-site | ||
fetch-depth: 1 | ||
ref: master | ||
token: ${{ secrets.FORMBUILDER_SITE_PAT }} | ||
|
||
git clone https://${TOKEN}@github.com/kevinchappell/formBuilder-site.git | ||
- name: Update website dependencies | ||
run: | | ||
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 | ||
git config --global user.name "GitHub Action" | ||
git config --global user.email "[email protected]" | ||
npm update formBuilder formBuilder-languages | ||
npm version ${{ steps.get-version.outputs.version }} | ||
git push --follow-tags |