-
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.
chore: add versioning release, use new fly deploy strategy
- Loading branch information
1 parent
fa27c19
commit 330cde8
Showing
11 changed files
with
92 additions
and
54 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 was deleted.
Oops, something went wrong.
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,34 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
UNCONDITIONAL_API_SOURCE_CLIENT_KEY: ${{ secrets.UNCONDITIONAL_API_SOURCE_CLIENT_KEY }} | ||
UNCONDITIONAL_API_BUILD_COMMIT_VERSION: ${{ github.sha }} | ||
UNCONDITIONAL_API_BUILD_RELEASE_VERSION: ${{ github.event.release.tag_name }} | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
|
||
jobs: | ||
deploy-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
- name: Prepare tools | ||
run: make install-tools | ||
- name: Get dependencies | ||
run: go get -v -t -d ./... | ||
- name: Install dependencies | ||
run: go mod download | ||
- name: Unit test | ||
run: make test-unit | ||
- name: Integration test | ||
run: make test-integration | ||
- name: Deploy | ||
run: chmod +x scripts/deploy.sh && sh scripts/deploy.sh |
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
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Install flyctl if isn't present | ||
if ! command -v flyctl &> /dev/null; then | ||
curl -L https://fly.io/install.sh | sh | ||
export FLYCTL_INSTALL="/home/runner/.fly" | ||
export PATH="$FLYCTL_INSTALL/bin:$PATH" | ||
fi | ||
|
||
# Deploy | ||
flyctl deploy --build-secret UNCONDITIONAL_API_SOURCE_CLIENT_KEY="$UNCONDITIONAL_API_SOURCE_CLIENT_KEY" \ | ||
--build-arg UNCONDITIONAL_API_BUILD_COMMIT_VERSION="$UNCONDITIONAL_API_BUILD_COMMIT_VERSION" \ | ||
--build-arg UNCONDITIONAL_API_BUILD_RELEASE_VERSION="$UNCONDITIONAL_API_BUILD_RELEASE_VERSION" \ | ||
--strategy bluegreen |