From ed7dc1ae93cf3c3ae71445096763a59d2628664d Mon Sep 17 00:00:00 2001 From: jjpkkkl <149959257+jjpkkkl@users.noreply.github.com> Date: Tue, 14 May 2024 10:33:10 +0000 Subject: [PATCH] ~$ --- .devcontainer/Dockerfile | 12 +++++++++++ .devcontainer/devcontainer.json | 24 +++++++++++++++++++++ .devcontainer/docker-compose.yml | 35 +++++++++++++++++++++++++++++++ .github/dependabot.yml | 36 +++++++++----------------------- action.yml | 7 +++---- 5 files changed, 84 insertions(+), 30 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..58c2344 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + +# [Optional] Uncomment if you want to install an additional version of node using nvm +# ARG EXTRA_NODE_VERSION=10 +# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" + +# [Optional] Uncomment if you want to install more global node modules +# RUN su node -c "npm install -g " diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..c8aea81 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node-postgres +{ + "name": "Node.js & PostgreSQL", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // This can be used to network with other containers or with the host. + // "forwardPorts": [3000, 5432], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..3b7c6e8 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,35 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile + + volumes: + - ../..:/workspaces:cached + + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity + + # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. + network_mode: service:db + + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + + db: + image: postgres:latest + restart: unless-stopped + volumes: + - postgres-data:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + POSTGRES_DB: postgres + + # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + +volumes: + postgres-data: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7bbed17..f33a02c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,28 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + version: 2 updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: weekly - groups: - actions-minor: - update-types: - - minor - - patch - ignore: - - dependency-name: "actions/attest-build-provenance" - - - package-ecosystem: npm - directory: / - schedule: - interval: weekly - groups: - npm-development: - dependency-type: development - update-types: - - minor - - patch - npm-production: - dependency-type: production - update-types: - - patch + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/action.yml b/action.yml index ea5dbb7..f806acc 100644 --- a/action.yml +++ b/action.yml @@ -54,7 +54,6 @@ runs: predicate-type: ${{ steps.generate-build-provenance-predicate.outputs.predicate-type }} predicate: ${{ steps.generate-build-provenance-predicate.outputs.predicate }} push-to-registry: ${{ inputs.push-to-registry }} - github-token: ${{ inputs.github-token }} - - name: Attest Build Provenance - uses: actions/attest-build-provenance@v1.1.1 - + github-token: ${{ inputs.github-token }}v + stone +