Skip to content

Commit

Permalink
Merge pull request #24 from shion1305/shion/fix-refresh-ci
Browse files Browse the repository at this point in the history
Refresh CI status_code取得方法を修正
  • Loading branch information
Shion1305 authored Mar 25, 2024
2 parents 38755ea + 7e53f8e commit 56947f0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 32 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/cron-refresh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ jobs:
steps:
- name: Access the endpoint
run: |
response=$(curl -s -w "%{http_code}" -o response.txt https://lumos-profile.shion.pro/api/refresh)
status_code=$(echo "$response" | tail -c 3)
echo "Status Code: $status_code"
status_code=$(curl -s -w "%{http_code}" -o response.txt https://lumos-profile.shion.pro/api/refresh)
echo "Response Content:"
cat response.txt
if [ "$status_code" -ne 200 ]; then
echo "Error: Unexpected status code $status_code"
exit 1
fi
fi
23 changes: 19 additions & 4 deletions .github/workflows/deploy-cloudrun-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: latest

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: create .env file
run: |
echo "${{ secrets.ENV_VARS }}" > .env
- name: Install dependencies and build
run: |
pnpm install
pnpm build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -42,10 +61,6 @@ jobs:
password: ${{ steps.auth.outputs.access_token }}
registry: asia-northeast1-docker.pkg.dev

- name: create .env file
run: |
echo "${{ secrets.ENV_VARS }}" > .env
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/deploy-cloudrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: latest

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: create .env file
run: |
echo "${{ secrets.ENV_VARS }}" > .env
- name: Install dependencies and build
run: |
pnpm install
pnpm build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -38,10 +57,6 @@ jobs:
password: ${{ steps.auth.outputs.access_token }}
registry: asia-northeast1-docker.pkg.dev

- name: create .env file
run: |
echo "${{ secrets.ENV_VARS }}" > .env
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down
25 changes: 5 additions & 20 deletions cloudrun/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
FROM gplane/pnpm:node20-alpine
#FROM gplane/pnpm:node20-alpine as builder
FROM node:20-slim

WORKDIR /app

COPY ./ ./
COPY .output .output
COPY .env .env
COPY package.json package.json

RUN pnpm install

RUN pnpm run build

CMD ["pnpm", "run", "start"]

#FROM node:20-slim as production
#
#WORKDIR /app
#
#COPY --from=builder /app/.output ./.output
#COPY --from=builder /app/.nuxt ./.nuxt
#ENV HOST=0.0.0.0
#
#ENV PORT=8080
#
#CMD ["node" ,"./.output/server/index.mjs"]
CMD ["npm", "run", "start"]
EXPOSE 8080

0 comments on commit 56947f0

Please sign in to comment.