Skip to content

Commit

Permalink
Adds support for version_from_env
Browse files Browse the repository at this point in the history
  • Loading branch information
kimpepper committed Sep 20, 2023
1 parent 29f228d commit 191c5cf
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
version:
type: string
description: The version to deploy
version_from_env:
type: string
description: Get the version to deploy from the environment.
post_deploy:
default: make deploy
type: string
Expand Down Expand Up @@ -42,17 +45,24 @@ jobs:
with:
fetch-depth: 0
show-progress: false
- name: Install Skpr CLI
run: |
gh release download --repo skpr/cli --pattern skpr_*_linux_amd64.deb -O skpr-cli.deb
sudo dpkg -i skpr-cli.deb
- name: Get version
id: version
run: |
if ${{ inputs.version == '' }}; then
if [ -n "${{ inputs.version }}" ]; then
version=${{ inputs.version }}
echo "::notice:: Using explicit version $version"
elif [ -n "${{ inputs.version_from_env }}" ]; then
version=$(skpr info ${{ inputs.version_from_env }} | jq -r ".Version")
echo "::notice:: Using version $version from ${{ inputs.version_from_env }} env"
else
version=$(git describe --tags --always)
echo "::notice:: Using version $version from git describe"
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Install Skpr CLI
run: |
gh release download --repo skpr/cli --pattern skpr_*_linux_amd64.deb -O skpr-cli.deb
sudo dpkg -i skpr-cli.deb
- name: Info
id: skpr-info
shell: bash
Expand All @@ -65,5 +75,6 @@ jobs:
run: skpr package ${{ steps.version.outputs.version }}
- name: Deploy
run: skpr deploy ${{ inputs.env }} ${{ steps.version.outputs.version }}
- name: Post-deploy Commands
- name: Post-deploy
run: skpr exec ${{ inputs.env }} ${{ inputs.post_deploy }}
- run: echo "::notice:: Deployed ${{ steps.version.outputs.version }}"

Check failure on line 80 in .github/workflows/deploy.yml

View workflow job for this annotation

GitHub Actions / run-actionlint

could not parse as YAML: yaml: line 80: mapping values are not allowed in this context

0 comments on commit 191c5cf

Please sign in to comment.