generated from arthurgeek/vaultwarden-fly-template
-
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.
feat: adds automatic fly deploy via github action (#5)
Co-authored-by: Arthur Zapparoli <[email protected]>
- Loading branch information
1 parent
155eeaf
commit b6b3655
Showing
12 changed files
with
115 additions
and
9 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,51 @@ | ||
name: Deploy to Fly | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- Dockerfile | ||
- fly.toml | ||
- config/** | ||
- scripts/** | ||
|
||
jobs: | ||
check-fly-secret: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
fly-secret-exists: ${{ steps.fly-secret-check.outputs.defined }} | ||
steps: | ||
- name: Check for Fly secrets availability | ||
id: fly-secret-check | ||
# perform secret check & put boolean result as an output | ||
shell: bash | ||
run: | | ||
if [ "${{ secrets.FLY_API_TOKEN }}" != '' ] && [ "${{ secrets.FLY_APP }}" != '' ]; then | ||
echo "defined=true" >> $GITHUB_OUTPUT; | ||
else | ||
echo "defined=false" >> $GITHUB_OUTPUT; | ||
fi | ||
deploy: | ||
name: Deploy app | ||
runs-on: ubuntu-latest | ||
needs: [check-fly-secret] | ||
if: needs.check-fly-secret.outputs.fly-secret-exists == 'true' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: superfly/flyctl-actions/setup-flyctl@master | ||
with: | ||
version: 0.1.54 | ||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
with: | ||
# renovate: datasource=github-releases depName=go-task/task | ||
version: 3.27.1 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Deploy app | ||
run: flyctl deploy --remote-only -a $FLY_APP | ||
env: | ||
FLY_APP: ${{ secrets.FLY_APP }} | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
version: "3" | ||
|
||
includes: | ||
logs: FlyLogs.yaml | ||
logs: logs.yaml | ||
|
||
tasks: | ||
create: | ||
|
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
--- | ||
version: "3" | ||
|
||
includes: | ||
app: app.yaml | ||
volume: volume.yaml | ||
secrets: secrets.yaml |
File renamed without changes.
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,10 @@ | ||
--- | ||
version: "3" | ||
|
||
tasks: | ||
set: | ||
cmds: | ||
- | | ||
fly_token=$(fly auth token 2>&1) | ||
gh secret set FLY_APP -b {{.FLY_APP}} | ||
gh secret set FLY_API_TOKEN -b $fly_token |
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,6 @@ | ||
--- | ||
version: "3" | ||
|
||
includes: | ||
secrets: secrets.yaml | ||
workflow: workflow.yaml |
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,7 @@ | ||
--- | ||
version: "3" | ||
|
||
tasks: | ||
deploy: | ||
cmds: | ||
- gh workflow run fly-deploy.yaml |
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