Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
revert: feat(action): migrate from docker to node (#267)
Browse files Browse the repository at this point in the history
This reverts commit 6fd10ff.
  • Loading branch information
aslafy-z committed Aug 10, 2023
1 parent 47d0782 commit 2ce59b0
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/
node_modules/

5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ updates:
directory: "/"
schedule:
interval: "daily"
# Maintain dependencies for docker
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
61 changes: 61 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: docker-image

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: [ main ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ main ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
with:
extra_plugins: |
conventional-changelog-conventionalcommits@latest
@semantic-release/exec@6.0.3
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:19-alpine

ADD package.json package-lock.json /action/
RUN cd /action && npm ci

ADD src /action/src
ENTRYPOINT ["node", "/action/src/index.js"]
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ inputs:
required: false
default: https://www.conventionalcommits.org/en/v1.0.0/#summary
runs:
using: node16
main: dist/index.js
using: docker
image: Dockerfile
branding:
icon: shield
color: green
17 changes: 0 additions & 17 deletions dist/index.js

This file was deleted.

20 changes: 2 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "conventional-pr-title-action",
"version": "3.1.0",
"version": "0.1.0",
"description": "Ensure your PR title matches the Conventional Commits spec.",
"main": "src/index.js",
"scripts": {
"test": "jest src",
"release": "semantic-release",
"build": "ncc build src/index.js -o dist -m"
"release": "semantic-release"
},
"repository": {
"type": "git",
Expand All @@ -31,7 +30,6 @@
"npm-package-arg": "^10.1.0"
},
"devDependencies": {
"@vercel/ncc": "^0.36.1",
"jest": "29.6.2"
},
"engines": {
Expand Down
10 changes: 1 addition & 9 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ module.exports = {
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/exec", {
prepareCmd: "npm ci && npm run build",
}],
["@semantic-release/npm", {
npmPublish: false,
}],
["@semantic-release/git", {
assets: ["package.json", "package-lock.json", "dist"],
}],
"@semantic-release/git",
"@semantic-release/github",
],
};

0 comments on commit 2ce59b0

Please sign in to comment.