Dummy CI #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: Dummy CI | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
microservice: | |
required: true | |
type: choice | |
description: Name of microservice | |
options: | |
- monalisa | |
- cschleiden | |
tag: | |
required: true | |
type: string | |
description: Version tag | |
default: 20230928.PR123.R3 | |
commit-sha: | |
required: true | |
type: string | |
description: Commit SHA to checkout | |
default: 07ef390a69c3341f1f635320903a6d9350a4e80a | |
permissions: | |
contents: write | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Runs a single command using the runners shell | |
- name: Run a one-line script | |
run: echo Hello, world! | |
# Runs a set of commands using the runners shell | |
- name: Run a multi-line script | |
run: | | |
echo Add other actions to build, | |
echo test, and deploy your project. | |
- name: Create a tag on the input commit (gh-api) | |
continue-on-error: true | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { VERSION_TAG, COMMIT_SHA } = process.env | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `refs/tags/${VERSION_TAG}`, | |
sha: COMMIT_SHA | |
}) | |
env: | |
VERSION_TAG: v${{ inputs.tag }}-${{ inputs.microservice }} | |
COMMIT_SHA: ${{ inputs.commit-sha }} | |
- name: Create a tag on the input commit (gh-cli) | |
continue-on-error: true | |
run: | | |
gh release create ${{ env.VERSION_TAG }} --target ${{ env.COMMIT_SHA }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
VERSION_TAG: v${{ inputs.tag }}-${{ inputs.microservice }} | |
COMMIT_SHA: ${{ inputs.commit-sha }} | |
- name: Create a tag on the input commit (git-cli) | |
continue-on-error: true | |
run: | | |
git tag ${{ env.VERSION_TAG }} ${{ env.COMMIT_SHA }} | |
git push --tag | |
env: | |
VERSION_TAG: v${{ inputs.tag }}-${{ inputs.microservice }} | |
COMMIT_SHA: ${{ inputs.commit-sha }} |