Skip to content

Commit

Permalink
ci: release時にfly.io用のファイルも付属させるようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
kizahasi committed Sep 5, 2022
1 parent 4b268e0 commit 9d51e06
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,28 @@ 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
- name: mv out directory
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
1 change: 1 addition & 0 deletions apps/api-server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.env.local
/bcrypt-hash.txt
/flyio.Dockerfile
# テストを実行するとuploaderディレクトリに画像ファイルが生成される。もしアップローダーのテストが失敗するとこれらが残ることがあるため、除外している。
/uploader
1 change: 1 addition & 0 deletions apps/api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions apps/api-server/run-generateFlyioDockerfile.ts
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 9d51e06

Please sign in to comment.