This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
SWAN CI/CD pipeline #58
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 | |
# author: [email protected] 2020 | |
name: SWAN CI/CD pipeline | |
on: | |
workflow_dispatch: | |
inputs: | |
package: | |
description: 'Package Name' | |
required: true | |
default: '' | |
version: | |
description: 'Package Version' | |
required: true | |
default: '' | |
jobs: | |
update-package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
ref: master | |
- name: Update package version | |
run: | | |
echo "Updating information for package = ${{ github.event.inputs.package }} version = ${{ github.event.inputs.version }}" | |
export PKG_NAME_LOWER=$(echo " ${{ github.event.inputs.package }}" | tr '[:upper:]' '[:lower:]') | |
export PKG_VER=$(echo ${{ github.event.inputs.version }} | sed -e "s/v//g") | |
sed -i "s/\( $PKG_NAME_LOWER==*\)[^ ]*/\1$PKG_VER/" Dockerfile | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Updated package ${{ github.event.inputs.package }} to version ${{ github.event.inputs.version }}" | |
branch: '${{ github.event.inputs.package }}-${{ github.event.inputs.version }}' | |
delete-branch: true | |
title: "Updated package ${{ github.event.inputs.package }} to version ${{ github.event.inputs.version }}" |