This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add pipeline for publishing scripts (#31)
* chore: add pipeline for publishing scripts * allow manual publish for branch
- Loading branch information
1 parent
ad5af95
commit 88aa1d1
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release scripts | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Determine major version to publish | ||
id: majorver | ||
run: | | ||
tag=$(basename $GITHUB_REF) | ||
if [[ $GITHUB_REF == *"/tags/"* ]]; then | ||
echo "::set-output name=major::${tag%.*.*}" | ||
else | ||
# Use branch name as major if not triggered for a tag | ||
echo "::set-output name=major::$tag" | ||
fi | ||
- name: Archive Release | ||
uses: thedoctor0/zip-release@master | ||
with: | ||
filename: 'docker-swarm-${{ steps.majorver.outputs.major }}.zip' | ||
path: scripts | ||
|
||
- uses: bacongobbler/[email protected] | ||
with: | ||
source_dir: . | ||
container_name: swarm-scripts | ||
account_name: ccppi | ||
sas_token: ${{ secrets.SasToken }} | ||
extra_args: '--pattern *.zip' | ||
sync: false |