diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1ce1983f..370b39274 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Install - run: yarn + - run: yarn + - name: Build web-server run: yarn run export working-directory: ./apps/web-server @@ -21,8 +21,19 @@ jobs: run: mv ./apps/web-server/out ./out - name: Create flocon_web_server.zip run: zip -r ${GITHUB_WORKSPACE}/flocon_web_server.zip ./out + + - name: Generate Dockerfile + run: yarn run gen-flyio-dockerfile + working-directory: ./apps/api-server + - name: mv Dockerfile + run: mv ./apps/api-server/flyio.Dockerfile ./Dockerfile + - name: Create flocon_api_server_flyio.zip + run: zip ${GITHUB_WORKSPACE}/flocon_api_server_flyio.zip ./Dockerfile + - name: Release uses: softprops/action-gh-release@v1 with: - files: flocon_web_server.zip + files: | + flocon_web_server.zip + flocon_api_server_flyio.zip draft: true diff --git a/apps/api-server/.gitignore b/apps/api-server/.gitignore index cdfcd94cf..90356683e 100644 --- a/apps/api-server/.gitignore +++ b/apps/api-server/.gitignore @@ -1,4 +1,5 @@ /.env.local /bcrypt-hash.txt +/flyio.Dockerfile # テストを実行するとuploaderディレクトリに画像ファイルが生成される。もしアップローダーのテストが失敗するとこれらが残ることがあるため、除外している。 /uploader \ No newline at end of file diff --git a/apps/api-server/package.json b/apps/api-server/package.json index 1e5737e38..38458711d 100644 --- a/apps/api-server/package.json +++ b/apps/api-server/package.json @@ -94,6 +94,7 @@ "gen": "run-s gen:schema gen:codegen", "gen:codegen": "graphql-codegen --config codegen.yml", "gen:schema": "ts-node run-buildSchemaSync.ts", + "gen-flyio-dockerfile": "ts-node run-generateFlyioDockerfile.ts", "start": "node dist/index.js", "bcrypt-interactive": "ts-node run-bcryptInteractive.ts", "migration-check": "node dist/run-migrationCheck.js", diff --git a/apps/api-server/run-generateFlyioDockerfile.ts b/apps/api-server/run-generateFlyioDockerfile.ts new file mode 100644 index 000000000..961e2a058 --- /dev/null +++ b/apps/api-server/run-generateFlyioDockerfile.ts @@ -0,0 +1,10 @@ +import { VERSION } from './src/VERSION'; +import fs from 'fs-extra'; + +const main = (): void => { + const version = VERSION.toString(); + const text = `FROM kizahasi/flocon-api-swap256mb:v${version}`; + fs.writeFileSync('./flyio.Dockerfile', text); +}; + +main();