Skip to content

Commit

Permalink
Update for devcontainer usage
Browse files Browse the repository at this point in the history
  • Loading branch information
avonbied committed Sep 24, 2024
1 parent c17f34e commit e75c4b2
Show file tree
Hide file tree
Showing 122 changed files with 268,101 additions and 268,112 deletions.
32 changes: 13 additions & 19 deletions app/Dockerfile → .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# syntax=docker/dockerfile:1
FROM node:lts-alpine

ARG PORT=3000
ENV PORT ${PORT}

ENV YARN_CACHE_FOLDER=/cache/yarn
WORKDIR /home/node/app

# Install packages
COPY package*.json yarn.lock ./
RUN --mount=type=cache,target=/cache/yarn \
yarn install

COPY . .

EXPOSE ${PORT}

CMD ["yarn", "start"]
# syntax=docker/dockerfile:1
FROM node:lts-alpine

ARG WORK_DIR=/home/node/app

RUN apk add --no-cache git
ENV YARN_CACHE_FOLDER=/cache/yarn
WORKDIR ${WORK_DIR}

# Install packages
COPY package*.json yarn.lock ./
RUN --mount=type=cache,target=/cache/yarn \
yarn install
52 changes: 26 additions & 26 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-dockerfile
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-dockerfile
{
"name": "AstroJS Dockerfile",
"build": {
"context": "..",
"dockerfile": "Dockerfile",
"args": {
"WORK_DIR": "${containerWorkspaceFolder}"
}
},
"containerEnv": {
"PORT": "3000",
"WORK_DIR": "${containerWorkspaceFolder}"
},
"forwardPorts": [3000],
"postStartCommand": "yarn dev",
"customizations": {
"vscode": {
"extensions": [
"astro-build.astro-vscode",
"VisualStudioExptTeam.vscodeintellicode"
]
}
}
}
49 changes: 24 additions & 25 deletions app/.dockerignore → .dockerignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# Editor Files
.vscode/
.stackblitzrc
sandbox.config.json

# Supporting Files
.git/
.github/
.gitignore

.dockerignore
Dockerfile*
docker-compose*
compose.yaml

dist/
node_modules
npm-debug.log
README.md
LICENSE

# Working Files
docs/
test/
docs/
# Editor Files
.vscode/
.stackblitzrc
sandbox.config.json

# Supporting Files
.github/
.devcontainer/

.dockerignore
Dockerfile*
docker-compose*
compose.yaml

dist/
node_modules
npm-debug.log
README.md
LICENSE

# Working Files
docs/
test/
docs/
temp/
116 changes: 58 additions & 58 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
name: GitHub Pages CI (Astro)
on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

env:
BUILD_PATH: app

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen
cache: 'yarn'
cache-dependency-path: ${{ env.BUILD_PATH }}/*.lock
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: yarn install
working-directory: ${{ env.BUILD_PATH }}
- name: Build with Astro
run: |
yarn astro build \
--site "${{ steps.pages.outputs.origin }}" \
--base "${{ steps.pages.outputs.base_path }}"
working-directory: ${{ env.BUILD_PATH }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ${{ env.BUILD_PATH }}/dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
name: GitHub Pages CI (Astro)
on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

env:
BUILD_PATH: .

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/hydrogen
cache: 'yarn'
cache-dependency-path: ${{ env.BUILD_PATH }}/*.lock
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: yarn install
working-directory: ${{ env.BUILD_PATH }}
- name: Build with Astro
run: |
yarn astro build \
--site "${{ steps.pages.outputs.origin }}" \
--base "${{ steps.pages.outputs.base_path }}"
working-directory: ${{ env.BUILD_PATH }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ${{ env.BUILD_PATH }}/dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dependencies
**/*/node_modules
**/*/.pnp
node_modules/
.pnp/
.pnp.js
package-lock.json

Expand All @@ -13,8 +13,8 @@ package-lock.json
/coverage

# production
**/*/dist
**/*/.astro
dist/
.astro/

# misc
.DS_Store
Expand Down
Empty file removed .nojekyll
Empty file.
2 changes: 0 additions & 2 deletions app/.npmrc

This file was deleted.

40 changes: 20 additions & 20 deletions app/astro.config.ts → astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';

// https://astro.build/config
export default defineConfig({
site: 'https://avonbied.github.io',
integrations: [sitemap()],
server: {
port: Number(process.env.PORT ?? 8080),
host: true,
},
vite: {
server: {
watch: {
usePolling: true,
interval: 10000
}
}
}
});
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';

// https://astro.build/config
export default defineConfig({
site: 'https://avonbied.github.io',
integrations: [sitemap()],
server: {
port: Number(process.env.PORT ?? 8080),
host: true,
},
vite: {
server: {
watch: {
usePolling: true,
interval: 10000
}
}
}
});
14 changes: 0 additions & 14 deletions compose.yaml

This file was deleted.

56 changes: 28 additions & 28 deletions app/package.json → package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"name": "avonbied.github.io",
"version": "1.0.0",
"author": "Lex von Biedenfeld",
"repository": "https://github.com/avonbied/avonbied.github.io",
"license": "MIT",
"type": "module",
"private": true,
"scripts": {
"dev": "astro dev",
"prestart": "astro build",
"start": "astro check && tsc --noEmit && astro preview",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@astrojs/sitemap": "^3.1.2",
"astro": "^4.5.16"
},
"devDependencies": {
"@astrojs/check": "^0.3.4",
"@types/node": "^20.8.10",
"sass": "^1.74.1",
"typescript": "^5.4.4"
}
}
{
"name": "avonbied.github.io",
"version": "1.0.0",
"author": "Lex von Biedenfeld",
"repository": "https://github.com/avonbied/avonbied.github.io",
"license": "MIT",
"type": "module",
"private": true,
"scripts": {
"dev": "astro dev",
"prestart": "astro build",
"start": "astro check && tsc --noEmit && astro preview",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@astrojs/sitemap": "^3.1.2",
"astro": "^4.5.16"
},
"devDependencies": {
"@astrojs/check": "^0.3.4",
"@types/node": "^20.8.10",
"sass": "^1.74.1",
"typescript": "^5.4.4"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit e75c4b2

Please sign in to comment.