This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from storageos/add-docker-releaser
Add docker releaser
- Loading branch information
Showing
2 changed files
with
46 additions
and
3 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 |
---|---|---|
|
@@ -6,9 +6,23 @@ on: | |
- 'v*' | ||
|
||
jobs: | ||
env-set-up: | ||
runs-on: ubuntu-latest | ||
name: Set up environment | ||
steps: | ||
- name: Set Version Environment Variables | ||
run: | | ||
echo "VERSION_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
# Remove leading v | ||
# Do parameter expansion outside of assignment | ||
version_tag=${{ env.VERSION }} | ||
semvar=${version_tag#v} | ||
echo "SEMANTIC_VERSION=$semvar" >> $GITHUB_ENV | ||
publish-binaries: | ||
runs-on: ubuntu-latest | ||
name: Publish release binaries | ||
name: Publish release binaries to GitHub | ||
needs: env-set-up | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
@@ -19,7 +33,7 @@ jobs: | |
- name: Run tests | ||
run: make test-docker | ||
- name: Build binaries | ||
run: SEMANTIC_VERSION=${GITHUB_REF#refs/*/} make release-docker | ||
run: SEMANTIC_VERSION=${{ env.SEMANTIC_VERSION }} make release-docker | ||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
|
@@ -31,3 +45,21 @@ jobs: | |
./bin/release/storageos_linux_amd64.sha256 | ||
./bin/release/storageos_windows_amd64 | ||
./bin/release/storageos_windows_amd64.sha256 | ||
dockerhub-release: | ||
runs-on: ubuntu-18.04 | ||
name: Publish container to Dockerhub | ||
needs: [env-set-up, publish-binaries] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Login to container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKERHUB_CLI_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_CLI_PASSWORD }} | ||
- name: Build image | ||
run: SEMANTIC_VERSION=${{ env.SEMANTIC_VERSION }} make build-cli-image | ||
- name: Push image | ||
run: SEMANTIC_VERSION=${{ env.SEMANTIC_VERSION }} make push-cli-image |
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