diff --git a/.containerignore b/.containerignore deleted file mode 100644 index 96d87db..0000000 --- a/.containerignore +++ /dev/null @@ -1,8 +0,0 @@ -install_deps.sh -.github/ -.cz.toml -.eslintrc.json -.pre-commit-config.yaml -.prettierignore -.prettierrc.json -tests/ diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 439c326..0000000 --- a/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM node:20 - -LABEL "com.github.actions.icon"="blue" -LABEL "com.github.actions.color"="database" -LABEL "com.github.actions.name"="ejsonkms action" -LABEL "com.github.actions.description"="Execute encryption and decryption of json files using ejson" -LABEL "org.opencontainers.image.source"="https://github.com/compono/ejsonkms-action" - -COPY install-deps.sh /tmp -RUN /tmp/install-deps.sh - -COPY . /action -WORKDIR /action - -RUN npm install --omit=dev - -ENTRYPOINT ["node", "/action/index.js"] diff --git a/action.yml b/action.yml index 33b4c77..4432d16 100644 --- a/action.yml +++ b/action.yml @@ -27,5 +27,20 @@ outputs: description: "Decrypted JSON content" runs: - using: "docker" - image: "Dockerfile" + using: "composite" + steps: + - id: install-ejsonkms + run: sudo --preserve-env ${GITHUB_ACTION_PATH}/install-deps.sh + shell: bash + - id: install-nodejs + uses: actions/setup-node@v4 + with: + node-version: 20 + - id: npm-ci + name: Install Dependencies + working-directory: ${{ github.action_path }} + run: npm ci + shell: bash + - id: entrypoint + run: node ${GITHUB_ACTION_PATH}/index.js + shell: bash diff --git a/install-deps.sh b/install-deps.sh index 0b5740d..a0bfd7a 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -1,4 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash +set -e +set -o pipefail architecture="" machine=$(uname -m) @@ -14,4 +16,4 @@ curl -sLo ejsonkms.tar.gz https://github.com/envato/ejsonkms/releases/download/v tar xfvz ejsonkms.tar.gz &>/dev/null && \ mv ejsonkms /usr/local/bin/ && \ chmod +x /usr/local/bin/ejsonkms && \ - rm ejsonkms.tar.gz \ No newline at end of file + rm ejsonkms.tar.gz