From 920f85e18e01f5713ec8db55b46f0ab3a04aad53 Mon Sep 17 00:00:00 2001 From: melody-universe Date: Sat, 7 Aug 2021 14:19:59 -0700 Subject: [PATCH] switched from Docker to JS action --- .github/workflows/push.yml | 32 +++++++++++++++++++++++++++----- Dockerfile | 35 ----------------------------------- action.yml | 4 ++-- 3 files changed, 29 insertions(+), 42 deletions(-) delete mode 100644 Dockerfile diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2244c1c..0873fd1 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -6,9 +6,35 @@ on: - 'master' jobs: + commit-dependencies: + name: 'Commit dependencies' + runs-on: ubuntu-latest + + steps: + - name: 'Checkout source code' + uses: 'actions/checkout@v2' + with: + ref: ${{ github.ref }} + - name: 'Setup Node.js' + uses: 'actions/setup-node@v1' + with: + node-version: 12 + - name: 'commit dependencies' + run: | + npm ci --production + git config user.name "Automated Version Bump" + git config user.email "gh-action-bump-version@users.noreply.github.com" + git add node_modules -f + if [ $(git status --porcelain=v1 2>/dev/null | wc -l) -gt 0 ] + then + git commit -m "ci: commit dependencies" + git push + fi + bump-version: name: 'Bump Version on master' runs-on: ubuntu-latest + needs: commit-dependencies steps: - name: 'Checkout source code' @@ -17,13 +43,9 @@ jobs: ref: ${{ github.ref }} - name: 'cat package.json' run: cat ./package.json - - name: 'Setup Node.js' - uses: 'actions/setup-node@v1' - with: - node-version: 12 - name: 'Automated Version Bump' id: version-bump - uses: 'phips28/gh-action-bump-version@master' + uses: 'melody-universe/gh-action-bump-version@master' with: tag-prefix: 'v' env: diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4a7dad4..0000000 --- a/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -# Use the latest version of Node.js -# -# You may prefer the full image: -# FROM node -# -# or even an alpine image (a smaller, faster, less-feature-complete image): -# FROM node:alpine -# -# You can specify a version: -# FROM node:10-slim -FROM node:15.12.0-slim - -# Labels for GitHub to read your action -LABEL "com.github.actions.name"="Automated version bump for npm packages." -LABEL "com.github.actions.description"="Automated version bump for npm packages." -# Here are all of the available icons: https://feathericons.com/ -LABEL "com.github.actions.icon"="chevron-up" -# And all of the available colors: https://developer.github.com/actions/creating-github-actions/creating-a-docker-container/#label -LABEL "com.github.actions.color"="blue" - -# Copy the package.json and package-lock.json -COPY package*.json ./ - -# Install dependencies -RUN apt-get update -RUN apt-get -y install git - -RUN npm ci --only=production - - -# Copy the rest of your action's code -COPY . . - -# Run `node /index.js` -ENTRYPOINT ["node", "/index.js"] diff --git a/action.yml b/action.yml index 59c8979..d28b671 100644 --- a/action.yml +++ b/action.yml @@ -1,8 +1,8 @@ name: Automated Version Bump description: Automated version bump for npm packages. runs: - using: docker - image: Dockerfile + using: node12 + main: index.js branding: icon: chevron-up color: blue