-
Notifications
You must be signed in to change notification settings - Fork 5
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
ae1caa1
commit 0d8b82e
Showing
4 changed files
with
78 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
website: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build |
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,38 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
website: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
run: ./deploy.sh |
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,15 +1,14 @@ | ||
#!/bin/bash | ||
|
||
WD=$(pwd) | ||
CLONE_DIR="/go/website" | ||
git clone https://${GITHUB_TOKEN}@github.com/aerokube/selenoid.git ${CLONE_DIR} | ||
CLONE_DIR="${GITHUB_WORKSPACE}/selenoid" | ||
git clone -b gh-pages https://${GITHUB_TOKEN}@github.com/aerokube/selenoid.git ${CLONE_DIR} | ||
cd ${CLONE_DIR} | ||
git config user.name ${DRONE_COMMIT_AUTHOR} | ||
git config user.email ${DRONE_COMMIT_AUTHOR_EMAIL} | ||
git checkout gh-pages | ||
git config user.name "${GITHUB_REPOSITORY}" | ||
git config user.email "[email protected]" | ||
git rm ${CLONE_DIR}/main.*.css | ||
git rm ${CLONE_DIR}/main.*.js | ||
cp -R ${WD}/dist/* ${CLONE_DIR} | ||
git add --all | ||
git commit -am "Updated by ${DRONE_COMMIT_AUTHOR}" | ||
git commit -am "Updated website" | ||
git push origin HEAD:gh-pages |