Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fork out docker release workflow #295

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Hub Release
on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Fetch tag
id: get-tag
run: |
git fetch --tags
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))"
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: twilio/twilio-cli
tags: type=semver,pattern={{version}}, value= ${{ steps.get-tag.outputs.TAG_NAME }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Image digest
run: |
echo ${{ steps.docker_build.outputs.digest }}
41 changes: 10 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,47 +74,26 @@ jobs:
with:
is_append_body: true
body: ${{ github.event.inputs.change-log }}
deploy-docker:
oclif-release:
runs-on: ubuntu-latest
needs: [ release ]

steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
uses: docker/metadata-action@v3
with:
images: twilio/twilio-cli
tags: type=semver,pattern={{version}}, value= ${{ needs.release.outputs.tag-name }}
- name: Build and push
- name: Invoke Oclif workflow
if: ${{needs.release.outputs.tag-name != ''}}
id: docker_build
uses: docker/build-push-action@v2
uses: benc-uk/workflow-dispatch@v1
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Image digest
run: |
echo ${{ steps.docker_build.outputs.digest }}
oclif-release:
workflow: Oclif Release
repo: twilio/twilio-cli
token: ${{ secrets.REPO_ACCESS_TOKEN }}
inputs: '{ "home-brew-branch": "${{github.event.inputs.homebrew-branch}}", "tag-name": "${{needs.release.outputs.tag-name}}", "pre-release": "${{github.event.inputs.homebrew-prerelease}}"}'
docker-release:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Invoke CLI workflow with changelog and version-type
- name: Invoke Docker workflow
if: ${{needs.release.outputs.tag-name != ''}}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Oclif Release
workflow: Docker Hub Release
repo: twilio/twilio-cli
token: ${{ secrets.REPO_ACCESS_TOKEN }}
inputs: '{ "home-brew-branch": "${{github.event.inputs.homebrew-branch}}", "tag-name": "${{needs.release.outputs.tag-name}}", "pre-release": "${{github.event.inputs.homebrew-prerelease}}"}'