-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from wisemen-digital/feature/github-actions
GitHub actions
- Loading branch information
Showing
11 changed files
with
453 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# General | ||
**/.DS_Store | ||
**/*.md | ||
**/LICENSE | ||
**/.vscode | ||
|
||
# Git | ||
**/.git | ||
**/.github | ||
**/.gitattributes | ||
**/.gitignore | ||
|
||
# Docker | ||
**/.dockerignore | ||
**/Dockerfile | ||
|
||
# Node | ||
**/.output | ||
**/.nuxt | ||
**/node_modules/ | ||
**/dist | ||
**/npm-debug.log | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
NUXT_PUBLIC_BASE_URL=http://localhost:3000 | ||
NUXT_PUBLIC_BASE_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Auto-deploy to development | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-deploy: | ||
uses: wisemen-digital/devops-github-actions/.github/workflows/workflow-build-and-deploy-scaleway.yml@main | ||
with: | ||
environment: development | ||
scaleway-container-registry: ${{ vars.CONTAINER_REGISTRY_ENDPOINT }} | ||
scaleway-organization-id: ${{ vars.SCALEWAY_ORGANIZATION_ID }} | ||
scaleway-project-id: ${{ vars.SCALEWAY_PROJECT_ID }} | ||
scaleway-region: ${{ vars.SCALEWAY_REGION }} | ||
scaleway-cluster-id: ${{ vars.K8S_CLUSTER_ID }} | ||
cluster-deployments: ${{ vars.K8S_DEPLOYMENTS }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Promote to enviroment | ||
|
||
on: # yamllint disable-line rule:truthy | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: Target environment to deploy TO | ||
type: environment | ||
required: true | ||
source-tag: | ||
description: Source tag (defaults to previous environment) | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
promote-to-env: | ||
uses: wisemen-digital/devops-github-actions/.github/workflows/workflow-promote-to-environment-scaleway.yml@main | ||
with: | ||
environment-source: ${{ inputs.source-tag }} | ||
environment-target: ${{ inputs.environment }} | ||
scaleway-container-registry: ${{ vars.CONTAINER_REGISTRY_ENDPOINT }} | ||
scaleway-organization-id: ${{ vars.SCALEWAY_ORGANIZATION_ID }} | ||
scaleway-project-id: ${{ vars.SCALEWAY_PROJECT_ID }} | ||
scaleway-region: ${{ vars.SCALEWAY_REGION }} | ||
scaleway-cluster-id: ${{ vars.K8S_CLUSTER_ID }} | ||
cluster-deployments: ${{ vars.K8S_DEPLOYMENTS }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: PR Check | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-build-test: | ||
uses: wisemen-digital/devops-github-actions/.github/workflows/nuxt-build-and-test.yml@main | ||
if: github.event.pull_request.draft == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
FROM node:20-alpine as build-stage | ||
# Command line arguments, such as Node version | ||
ARG NODE_VERSION=lts | ||
|
||
# | ||
# --- Stage 1: Build --- | ||
# | ||
|
||
FROM node:${NODE_VERSION} as build | ||
|
||
RUN corepack enable pnpm | ||
|
||
# Install dependencies | ||
WORKDIR /app | ||
COPY package.json pnpm-lock.yaml tsconfig.json .npmrc ./ | ||
RUN pnpm install --frozen-lockfile | ||
|
||
# Copy files | ||
COPY . . | ||
|
||
RUN pnpm install --frozen-lockfile | ||
|
||
# Build & optimize a bit | ||
RUN pnpm run build | ||
|
||
FROM node:20-alpine as production-stage | ||
# | ||
# --- Stage 2: Run --- | ||
# | ||
|
||
COPY --from=build-stage /app/.output . | ||
FROM ghcr.io/wisemen-digital/nuxt-base:${NODE_VERSION} as final | ||
|
||
EXPOSE 3000 | ||
ENTRYPOINT ["node", "./server/index.mjs"] | ||
# Add application | ||
COPY --from=build --chown=nobody /app/.output /app/www/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"name": "nuxt-app", | ||
"type": "module", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"build": "nuxt build", | ||
"build_local": "nuxt build && node .output/server/index.mjs", | ||
|
@@ -26,6 +27,7 @@ | |
"@antfu/eslint-config": "2.11.0", | ||
"@nuxt/devtools": "latest", | ||
"@nuxt/image": "1.4.0", | ||
"@nuxt/test-utils": "3.12.0", | ||
"@nuxtjs/tailwindcss": "^6.11.4", | ||
"@tailwindcss/typography": "^0.5.12", | ||
"@vueuse/nuxt": "10.9.0", | ||
|
@@ -34,6 +36,7 @@ | |
"eslint-plugin-tailwindcss": "3.15.1", | ||
"sass": "1.72.0", | ||
"typescript": "5.4.3", | ||
"vitest": "1.4.0", | ||
"vue-tsc": "2.0.7" | ||
} | ||
} |
Oops, something went wrong.