File tree 1 file changed +2
-28
lines changed
1 file changed +2
-28
lines changed Original file line number Diff line number Diff line change @@ -28,38 +28,12 @@ jobs:
28
28
name : build
29
29
path : output.tar.gz
30
30
31
- deploy-pr :
32
- if : github.event_name == 'pull_request'
33
- runs-on : ubuntu-latest
34
- needs : build
35
- environment :
36
- name : pr
37
- url : ${{ steps.deploy.outputs.url }}
38
- steps :
39
- - name : download build artifact
40
- uses : actions/download-artifact@v3
41
- with :
42
- name : build
43
- - name : extract output
44
- run : tar -xzf output.tar.gz
45
- - name : install swa cli
46
- run : npm install -g @azure/static-web-apps-cli
47
- - name : deploy app
48
- id : deploy
49
- run : |
50
- # deploy site with swa
51
- set -o pipefail
52
- swa deploy ./out --deployment-token ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} \
53
- --env ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} 2>&1 | tee deploy.log
54
- url=$(grep 'Project deployed to' deploy.log | awk '{print $5}' | sed 's/\x1b\[[0-9;]*m//g')
55
- echo "url=$url" >> "$GITHUB_OUTPUT"
56
-
57
- deploy-production :
31
+ deploy :
58
32
if : github.event_name != 'pull_request'
59
33
runs-on : ubuntu-latest
60
34
needs : build
61
35
environment :
62
- name : dev
36
+ name : ${{ github.event_name == 'pull_request' && 'pr' || ' dev' }}
63
37
url : ${{ steps.deploy.outputs.url }}
64
38
steps :
65
39
- name : download build artifact
You can’t perform that action at this time.
0 commit comments