-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deployment to use public source repository
- Loading branch information
Showing
3 changed files
with
5 additions
and
25 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,29 +1,19 @@ | ||
name: Deploy | ||
|
||
# Uses "pull_request_target" to expose the DEPLOY_KEY secret to PRs from forks in order to allow installing Framework X from a private repository. | ||
# We need to explicitly check out the PR head which may potentially expose the secrets to malicious PR authors. | ||
# Accordingly, we use the DEPLOY_KEY only to clone Framework X and then discard its value before running commands from the Makefile. | ||
# Additionally, the DEPLOY_KEY is limited in scope may change over time. | ||
on: | ||
push: | ||
pull_request_target: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
Deploy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- run: mkdir -p ~/.ssh && echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa && chmod 400 ~/.ssh/id_rsa | ||
- run: git config --global user.name "GitHub Actions" && git config --global user.email "actions@github.com" | ||
- run: git clone git@github.com:clue-access/framework-x.git source/ | ||
- run: rm -r ~/.ssh/id_rsa | ||
if: ${{ github.event_name == 'pull_request_target' }} | ||
- run: git clone https://github.com/clue/framework-x.git source/ | ||
- run: make | ||
- run: make served | ||
- run: make test | ||
- run: git config --global user.name "GitHub Actions" && git config --global user.email "actions@github.com" | ||
- run: git config --global url."https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" | ||
- run: make deploy | ||
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request_target' }} | ||
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} |
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