Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MM53 committed Nov 15, 2022
0 parents commit 83c4fee
Show file tree
Hide file tree
Showing 18 changed files with 8,728 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@ionos-deploy-now/eslint-config-actions'],
};
72 changes: 72 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build release

on:
workflow_dispatch:
inputs:
version:
description: 'Version of release'
type: string
required: true
update-major-tag:
description: 'Update major release tag to current release'
type: boolean
required: true
default: false

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://npm.pkg.github.com'
- name: Setup project
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
- name: Test and build code
run: |
npm run lint
npm run test
npm run build
- name: Build release
run: |
npm version ${{ inputs.version }} --no-commit-hooks --no-git-tag-version
npm run release
- uses: stefanzweifel/git-auto-commit-action@v4
id: commit-step
with:
commit_message: Release version v${{ inputs.version }}
tagging_message: v${{ inputs.version }}
- if: inputs.update-major-tag
name: Update major version tag
uses: actions/github-script@v3
env:
VERSION: ${{ inputs.version }}
SHA: ${{ steps.commit-step.outputs.commit_hash }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { VERSION, SHA } = process.env
const tag = "v" + VERSION.split(".")[0]
if (tag === "v") {
return
}
try {
await github.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/" + tag
})
} catch (e) {
console.log("The tag " + tag + " doesn't exist yet.")
}
await github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/" + tag,
sha: SHA
})
23 changes: 23 additions & 0 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test and build action

on: push

jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://npm.pkg.github.com'
- name: Setup project
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
- name: Test and build code
run: |
npm run lint
npm run test
npm run build
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.iml
.idea

node_modules
lib
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Retrieve meta information of an IONOS Deploy Now project.

Do not use this action on your own. [IONOS Deploy Now](https://ionos.space) will setup this for you.
30 changes: 30 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'IONOS Deploy Now - Project Action'
description: 'Interact with IONOS Deploy Now to perform different actions on a project'
inputs:
service-host:
description: 'The service endpoint to call in the action'
required: true
api-key:
description: 'The api key to access IONOS Deploy Now'
required: true
project-id:
description: 'The identifier of the IONOS Deploy Now project'
required: true
branch-id:
description: 'The identifier of a branch'
required: false
deployment-id:
description: 'The identifier of a deployment'
required: false
status:
description: 'The status to set for a deployment'
required: false
action:
description: 'The action to perform'
required: true
outputs:
info:
description: 'A json object containing the requested info'
runs:
using: 'node16'
main: 'dist/index.js'
Loading

0 comments on commit 83c4fee

Please sign in to comment.