-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v10] add webassets automation (#1083)
- Loading branch information
Showing
4 changed files
with
71 additions
and
2 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,11 @@ | ||
name: docker-build-webassets | ||
author: Zac Bergquist <[email protected]> | ||
description: Build Teleport webassets in Docker | ||
|
||
runs: | ||
using: docker | ||
image: ../../../Dockerfile | ||
entrypoint: sh | ||
args: | ||
- -c | ||
- yarn install && yarn run build-teleport |
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,57 @@ | ||
name: Update Webassets | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- teleport-v** | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Get webapps, and the webapps.e submodule | ||
- name: Checkout webapps | ||
uses: actions/checkout@v3 | ||
with: | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
# Get webassets, and the webassets.e submodule | ||
- name: Checkout webassets | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: gravitational/webassets | ||
path: dist | ||
ref: ${{ github.ref_name }} | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
# This workflow only runs on push to a protected branch, so the code | ||
# has already been reviewed and is trusted. This means it is safe to | ||
# the version of the action that we checked out and we don't need to | ||
# always use master. | ||
- name: Build webassets | ||
uses: ./.github/actions/docker-build-webassets | ||
|
||
- name: Push updates | ||
run: | | ||
git config --global user.email [email protected] | ||
git config --global user.name "$GITHUB_ACTOR" | ||
echo "Updating webassets.e" | ||
cd dist/e | ||
git add -A | ||
git status | ||
git commit -m "Update webassets.e from gravitational/webapps@$GITHUB_SHA" --allow-empty | ||
git push origin HEAD:$GITHUB_REF_NAME | ||
echo "Updating webassets" | ||
cd .. | ||
git add -A | ||
git status | ||
git commit -m "Update webassets from gravitational/webapps@$GITHUB_SHA" --allow-empty | ||
git push origin HEAD:$GITHUB_REF_NAME |
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
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