-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change PR deployment to build artifact + deploy (#1576)
* Add build step; check github context * Fix build script * Fix build script * Add deployment script * Remove naming check * Update token * Update pathing * Update comments * Fix comment * Add title * Fix comment * Update clean script * Include ref in artifact * Update name * Move envfile to vars Co-authored-by: eeeqeee <103794572+eeeqeee@users.noreply.github.com> * Update new-release.yml to use var envfile --------- Co-authored-by: eeeqeee <103794572+eeeqeee@users.noreply.github.com>
- Loading branch information
1 parent
7ca0025
commit af59815
Showing
8 changed files
with
110 additions
and
125 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Build Frontend | ||
run-name: Build frontend of ${{ inputs.frontend_name }} for ${{ inputs.deployment_name }} - ${{ github.event.inputs.ref }} | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
frontend_name: | ||
description: 'Frontend type to build. Can be `frontend`, or `sr-frontend`' | ||
type: string | ||
repo_full_name: | ||
description: 'Full repository name to build from.' | ||
type: string | ||
default: 'frzyc/genshin-optimizer' | ||
ref: | ||
description: 'Ref to build from. Can be a commit hash.' | ||
type: string | ||
default: 'master' | ||
deployment_name: | ||
description: 'Name for the deployment. This will determine the URL. If you choose a name that is already deployed, it will overwrite that deployment.' | ||
type: string | ||
default: 'master' | ||
show_dev_components: | ||
description: 'Flag to show components typically only shown in development mode, for experimental or in-progress features.' | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.repo_full_name }} | ||
ref: ${{ inputs.ref }} | ||
submodules: true | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
- name: Yarn install | ||
run: | | ||
yarn install --immutable --immutable-cache | ||
- name: Setup .env | ||
run: | | ||
printf '%s' "$ENVFILE" > apps/frontend/.env.local | ||
env: | ||
ENVFILE: ${{ vars.ENVFILE }} | ||
- name: Build genshin-optimizer | ||
run: | | ||
NX_URL_GITHUB_GO_CURRENT_VERSION="https://github.com/${{ inputs.repo_full_name }}/commit/$(git rev-parse HEAD)" \ | ||
NX_DAEMON="false" \ | ||
NX_SHOW_DEV_COMPONENTS="${{inputs.show_dev_components}}" \ | ||
yarn run nx run ${{inputs.frontend_name}}:build-vite:production --base-href="" | ||
echo ${{inputs.frontend_name}} > frontend_name | ||
echo ${{inputs.deployment_name}} > deployment_name | ||
echo $(git rev-parse HEAD) > ref | ||
- name: Archive build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: frontend_build | ||
path: | | ||
dist/apps/${{inputs.frontend_name}} | ||
frontend_name | ||
deployment_name | ||
ref |
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
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
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