-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from adocasts/cleavr-github-actions-b9a7e7
[Cleavr] enable GitHub Actions
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 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,80 @@ | ||
|
||
|
||
# This GitHub Actions workflow is generated and deployed by https://cleavr.io | ||
# The filename, cleavr_1e8oego0ma, of this workflow is tracked from within Cleavr, | ||
# please don't change the name. Though, feel free to add your own steps or tweak | ||
# the existing ones except anything listed below the warning message. | ||
# Read more about Cleavr's GitHub Actions integration feature at: https://docs.cleavr.io/github-actions | ||
|
||
name: Deploy cms.adocasts.com App with Cleavr | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
# This is the branch that gets deployed when a push is made to this repository. | ||
# If you change the default branch in Cleavr under the Webapp's settings, make sure to change it here as well. | ||
- main | ||
jobs: | ||
init: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Start Cleavr Deployment | ||
uses: fjogeleit/http-request-action@master | ||
with: | ||
url: '${{ secrets.DEPLOY_TRIGGER_HOOK_cleavr_1e8oego0ma }}' | ||
method: 'POST' | ||
data: '{"status": "init" }' | ||
timeout: 60000 | ||
build: | ||
needs: init | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
cleavr-step-status: ${{ toJson(steps) }} | ||
artifact-formatted-time: ${{ steps.artifact.outputs.formattedTime }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
id: checkout | ||
|
||
- uses: actions/setup-node@v3 | ||
id: setup-node | ||
with: | ||
node-version: '20' | ||
|
||
- uses: bahmutov/npm-install@v1 | ||
id: npm-install | ||
|
||
- name: Build app | ||
id: build-app | ||
run: npm run build --production | ||
|
||
### --- PLEASE DO NOT MODIFY ANYTHING BELOW THIS LINE --- ### | ||
|
||
- name: Generate artifact name | ||
id: artifact | ||
uses: josStorer/get-current-time@v2.0.2 | ||
with: | ||
format: YYYYMMDDHHmmss | ||
utcOffset: "+08:00" | ||
|
||
- name: Upload artifact | ||
id: upload-artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: '${{ steps.artifact.outputs.formattedTime }}' | ||
path: build/ | ||
if-no-files-found: error | ||
|
||
complete: | ||
if: always() | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Complete Cleavr Deployment | ||
uses: fjogeleit/http-request-action@master | ||
with: | ||
url: '${{ secrets.DEPLOY_TRIGGER_HOOK_cleavr_1e8oego0ma }}' | ||
method: 'POST' | ||
data: '{"status": "${{ needs.build.result }}" , "steps": ${{ toJson(needs.build.outputs.cleavr-step-status) }} }' | ||
timeout: 60000 | ||
customHeaders: '{"artifact": "${{ needs.build.outputs.artifact-formatted-time }}"}' | ||
|