Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f6e5c9b

Browse files
committedDec 13, 2022
ci: update build workflow
1 parent 30faa4d commit f6e5c9b

File tree

6 files changed

+103
-23
lines changed

6 files changed

+103
-23
lines changed
 

‎.dockerignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
node_modules
2-
build
2+
dist
3+
.turbo
4+
.vite
35
README.md
6+
.github
7+
.idea
8+
.editorconfig
9+
.gitignore
10+
CONTRIBUTING.md
11+
sonar-project.properties

‎.github/workflows/ci.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎.github/workflows/pull_request.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pull Requests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
automated_review:
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- uses: pnpm/action-setup@v2
15+
with:
16+
version: 7
17+
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 16.x
21+
cache: 'pnpm'
22+
23+
- name: Install dependencies
24+
run: pnpm install
25+
26+
- name: Audit dependencies
27+
run: pnpm audit
28+
29+
- name: Linting code
30+
run: pnpm run --if-present lint
31+
32+
- name: Check code formatting
33+
run: pnpm run --if-present format

‎.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
drafter:
9+
permissions:
10+
contents: write
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: release-drafter/release-drafter@v5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
17+
package:
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
- id: meta
27+
uses: docker/metadata-action@v4
28+
with:
29+
images: ghcr.io/${{ github.repository }}
30+
flavor: ${{ inputs.docker-metadata-flavor }}
31+
- id: extract-env
32+
run: |
33+
if [[ "$GITHUB_REF_TYPE" == tag ]]
34+
then
35+
echo "environment=production" >> $GITHUB_OUTPUT
36+
else
37+
echo "environment=qa" >> $GITHUB_OUTPUT
38+
fi
39+
- uses: docker/build-push-action@v3
40+
with:
41+
build-args: |
42+
BUILD_MODE=${{ steps.extract-env.outputs.environment }}
43+
context: .
44+
file: Dockerfile.app
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

‎Dockerfile

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎Dockerfile.app

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ARG BUILD_MODE=production
2+
3+
FROM node:16 as build-web
4+
WORKDIR /build
5+
COPY . .
6+
RUN npm install -g pnpm && \
7+
pnpm install --frozen-lockfile && \
8+
BUILD_MODE=${BUILD_MODE} pnpm build
9+
10+
FROM nginx:stable-alpine
11+
COPY --from=build-web /build/apps/polyflix/dist /usr/share/nginx/html
12+
COPY .docker/nginx.conf /etc/nginx/conf.d/default.conf
13+
EXPOSE 8080
14+
CMD [ "nginx", "-g", "daemon off;" ]

0 commit comments

Comments
 (0)
Please sign in to comment.