diff --git a/.github/workflows/create-data.yml b/.github/workflows/create-data.yml index aec57e8..3f64fe8 100644 --- a/.github/workflows/create-data.yml +++ b/.github/workflows/create-data.yml @@ -58,6 +58,15 @@ jobs: run: | ./deploy/01_sync_to_s3.sh + - name: Create archive + run: | + ./deploy/01a_create_archive.sh + + - name: Upload archive to S3 + run: | + aws s3 cp \ + ./out/api.tar.zst s3://japanese-addresses-v2.geoloniamaps.com/experimental/api.tar.zst + clear-cdn-cache: needs: - create-data diff --git a/README.md b/README.md index 6126709..94c3570 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,17 @@ $ npm run run:03_make_rsdt # 住居表示住所API作成 (町字APIが先に作 $ npm run run:04_make_chiban # 地番住所API作成 (町字APIが先に作らないとエラーになります) ``` +TARファイルに丸める場合は + +```shell +VERSION="$(date -u '+%4Y%m%d%H%M%S')" +cd ./out +tar -cf "api-$VERSION.tar" ./api +zstd -T0 -19 -z "api-$VERSION.tar" +``` + +`deploy/01a_create_archive.sh` を参照してください + ### API の構成 ```shell diff --git a/deploy/01a_create_archive.sh b/deploy/01a_create_archive.sh new file mode 100755 index 0000000..ac00eaf --- /dev/null +++ b/deploy/01a_create_archive.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +cd "$(dirname "$0")"/../out +tar -cf "api.tar" ./api +zstd -T0 -19 --rm -z "api.tar"