diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d36a85b..8213c97 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -65,6 +65,7 @@ jobs: export GIT_COMMIT_TIME=$(git log -1 --format="%ct") MIX_ENV=prod RELEASE_TAR=1 mix release + # https://github.com/softprops/action-gh-release - name: Make Github release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') @@ -89,7 +90,7 @@ jobs: # vsn=${{ github.ref_name }} # git_repo=${{ github.repository }} - # app_root=~/hello + # app_root=~/hello-api-elixir # script_path=${app_root}/deploy.sh # mkdir -p $app_root @@ -102,4 +103,4 @@ jobs: # echo "Use existed deploy-script: ${script_path}, manually delete it when need update" # fi - # $script_path $vsn $app_root bin/hello_api ${git_repo} 3 + # $script_path $vsn bin/hello_api ${git_repo} 3 diff --git a/CHANGELOG.md b/CHANGELOG.md index c3436a7..aade70d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,30 +7,21 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline ## [v0.1.4](https://github.com/cao7113/hello-api-elixir/compare/v0.1.3...v0.1.4) (2024-07-03) - - - ### Bug Fixes: -* release-bar action missing env +- release-bar action missing env ## [v0.1.3](https://github.com/cao7113/hello-api-elixir/compare/v0.1.2...v0.1.3) (2024-07-03) - - - ### Bug Fixes: -* try add release tar to github packages +- try add release tar to github releases ## [v0.1.2](https://github.com/cao7113/hello-api-elixir/compare/v0.1.1...v0.1.2) (2024-07-03) - - - ### Bug Fixes: -* add fly deploy by github actions and fix text +- add fly deploy by github actions and fix text ## [v0.1.1](https://github.com/cao7113/hello-api-elixir/compare/v0.1.0...v0.1.1) (2024-07-03) diff --git a/Taskfile.yml b/Taskfile.yml index 66e9f8e..b3fe6e9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,10 +1,13 @@ # https://taskfile.dev version: "3" + includes: + # fly related tasks fly-io: taskfile: ./Taskfile-fly-io.yml aliases: [f, fly] optional: true + tasks: default: mix test --no-start @@ -25,14 +28,21 @@ tasks: get-info: curl -v http://localhost:4000 | jq get-user: curl -s http://localhost:4000/users/123 - ## Docker images - dk-builder: docker pull hexpm/elixir:1.17.1-erlang-27.0-debian-bullseye-20240612-slim - dk-runner: docker pull debian:bullseye-20240612-slim - ## Git ops - cmt: mix git_ops.release + cmt: mix git_ops.release && git push --follow-tags app-info: mix git_ops.project_info init-release: mix git_ops.release --initial + ## Local prod env in Orbstack + # run `orb` into default ubuntu env, now in current project path + # run: `run/setup.sh _build/prod-orb` to setup deploy.sh + # run: `_build/prod-orb/deploy.sh v0.1.4` to deploy a version from github vsn release + # current release at: _build/prod-orb/current + # Visit by: http://ubox1.orb.local:4000/ + + ## Docker env + dk-builder: docker pull hexpm/elixir:1.17.1-erlang-27.0-debian-bullseye-20240612-slim + dk-runner: docker pull debian:bullseye-20240612-slim + # Init setup mk-hello: mix new hello-api-elixir --app hello_api --sup diff --git a/run/deploy.sh b/run/deploy.sh index 82148bf..5b7090a 100755 --- a/run/deploy.sh +++ b/run/deploy.sh @@ -1,13 +1,21 @@ #! /usr/bin/env sh +set -e -# ~/hello/deploy.sh v0.1.34 ~/hello bin/hello_api cao7113/hello-api-elixir 3 +if [ $# -lt 1 ]; then + cat <