Skip to content

Commit

Permalink
chore(chore): save state
Browse files Browse the repository at this point in the history
  • Loading branch information
anteqkois committed May 5, 2024
1 parent e2ba9a0 commit 00d7463
Show file tree
Hide file tree
Showing 6 changed files with 429 additions and 291 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: deploy-changed-apps

on:
workflow_dispatch
# on:
# push:
# branches:
# - master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
name: Check affected apps
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Restore cached npm dependencies
uses: actions/cache/restore@v3
with:
path: |
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: npm-dependencies-${{ hashFiles('package.json') }}
- name: Install dependencies
run: pnpm install
if: steps.cache.outputs.cache-hit != 'true'
- name: Cache npm dependencies
uses: actions/cache/save@v3
with:
path: |
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: npm-dependencies-${{ hashFiles('package.json') }}
- name: Build base image
run: npm run docker-base
- name: Tag image
run:
docker tag sample/my-page \
registry.digitalocean.com/my-sample-registry/my-sample-page:${{github.event.inputs.version }}
# Install doctl.
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
- run: npx [email protected] affected -t docker-compose --base=origin/master~1 --head=origin/master
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Thumbs.db

docs/examples/**

.nx/cache
.nx/cache
6 changes: 2 additions & 4 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ ARG BUILD_FLAG

WORKDIR /app/builder

# RUN ls apps/web/.next -a
RUN npx nx run web:build -d || echo "nx run web:build failed"
# RUN ls apps/web/.next -a
# RUN ls apps/web/.next/standalone
RUN npx nx run web:build || echo "nx run web:build failed"
RUN ls apps/web/.next

FROM node:lts-alpine AS runner

Expand Down
8 changes: 4 additions & 4 deletions apps/web/deploy-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -e
# Build images
docker build -t linkerry/web -f ./apps/web/Dockerfile . --platform=linux/amd64 --progress=plain

# Push docker image to container registry
docker login -u "$CONTAINER_REGISTRY_USERNAME" -p "$CONTAINER_REGISTRY_PASSWORD" "$CONTAINER_REGISTRY_ADDRESS"
# # Push docker image to container registry
# docker login -u "$CONTAINER_REGISTRY_USERNAME" -p "$CONTAINER_REGISTRY_PASSWORD" "$CONTAINER_REGISTRY_ADDRESS"

docker tag linkerry/web registry.digitalocean.com/linkerry/web:"$ENV"
docker push registry.digitalocean.com/linkerry/web:"$ENV"
# docker tag linkerry/web registry.digitalocean.com/linkerry/web:"$ENV"
# docker push registry.digitalocean.com/linkerry/web:"$ENV"
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"mongoose": "^8.3.2",
"mongoose-unique-validator": "^5.0.0",
"nanoid": "^3.3.6",
"next": "14.0.4",
"next": "14.2.3",
"next-themes": "^0.3.0",
"nodemailer": "^6.9.13",
"object-sizeof": "^2.6.4",
Expand Down Expand Up @@ -197,6 +197,11 @@
"verdaccio": "^5.0.4",
"webpack-cli": "^5.1.4"
},
"optionalDependencies": {
"@nx/nx-darwin-arm64": "18.3.4",
"@nx/nx-darwin-x64": "18.3.4",
"@nx/nx-linux-x64-gnu": "18.3.4"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
Expand Down
Loading

0 comments on commit 00d7463

Please sign in to comment.