File tree 1 file changed +41
-0
lines changed
1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy Web Server
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ concurrency :
7
+ group : ${{ github.workflow }}-${{ github.ref }}
8
+ cancel-in-progress : true
9
+
10
+ jobs :
11
+ build-and-deploy :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Set up fly
18
+ uses : superfly/flyctl-actions/setup-flyctl@master
19
+
20
+ - name : Set variables for production
21
+ run : |
22
+ echo "FLY_CONFIG=fly.toml" >> $GITHUB_ENV
23
+ echo "GIT_SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
24
+ echo "FLY_APP_NAME=indexer-v2" >> $GITHUB_ENV
25
+ if : ${{ github.ref == 'refs/heads/main' }}
26
+
27
+ - name : Build and test
28
+ run : |
29
+ flyctl -c ${{ env.FLY_CONFIG }} deploy --remote-only --build-only --push --image-label deployment-$GIT_SHA_SHORT
30
+ env :
31
+ FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN_PRODUCTION }}
32
+
33
+ - name : Deploy HTTP
34
+ run : |
35
+ flyctl -c ${{ env.FLY_CONFIG }} deploy --wait-timeout=7200 --env BUILD_TAG=`git rev-parse --short HEAD` --image registry.fly.io/$FLY_APP_NAME:deployment-$GIT_SHA_SHORT --process-groups=web
36
+ env :
37
+ FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN_PRODUCTION }}
38
+
39
+ - name : Smoke test
40
+ run : |
41
+ curl --silent --show-error --fail-with-body https://${{ env.FLY_APP_NAME }}.fly.dev/api/v1/status
You can’t perform that action at this time.
0 commit comments