Skip to content

Commit

Permalink
upgrade build pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjirku committed Dec 18, 2023
1 parent c5d8c78 commit ec71464
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ cmd = "go build -o ./tmp/main ./main.go"
delay = 200
exclude_dir = ["assets", "tmp", "vendor", "node_modules", "styles", "public"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_regex = ["_test.go", ".ts", ".css"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "templ", "html"]
include_ext = ["go"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,37 @@ name: Build and deploy

on:
push:
branches: ["migration-to-golang"]
branches: ["migration-to-golang", "dev", "main"]
env:
FLY_API_TOKEN: ${{ secrets. FLY_API_TOKEN }}
jobs:
build-mcmamina:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: πŸ‘€ Read app name
uses: SebRollen/[email protected]
id: app_name
with:
file: fly.toml
field: app

- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy
- name: πŸš€ Deploy Go
if: ${{ github.ref == 'refs/heads/migration-to-golang' }}
run: flyctl deploy --remote-only --region waw --build-arg COMMIT_SHA=${{ github.sha }} --app ${{ steps.app_name.outputs.value }}-go
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

- name: πŸš€ Deploy Staging
if: ${{ github.ref == 'refs/heads/dev' }}
run: flyctl deploy --remote-only --region waw --build-arg COMMIT_SHA=${{ github.sha }} --app ${{ steps.app_name.outputs.value }}-staging
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

- name: πŸš€ Deploy Production
if: ${{ github.ref == 'refs/heads/main' }}
run: flyctl deploy --remote-only --region waw --build-arg COMMIT_SHA=${{ github.sha }} --app ${{ steps.app_name.outputs.value }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
4 changes: 1 addition & 3 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "mcmamina-go"
app = "mcmamina"

kill_signal = "SIGINT"
kill_timeout = 5
# primary_region = "waw"


[[vm]]
cpu_kind = "shared"
Expand Down

0 comments on commit ec71464

Please sign in to comment.