Skip to content

Commit

Permalink
chore: Add docker workflow to github actions (twilio#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuj Badhwar committed Sep 14, 2021
1 parent 49e2376 commit 7e9d233
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,36 @@ jobs:
with:
is_append_body: true
body: ${{ github.event.inputs.change-log }}

deploy-docker:
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
if: ${{needs.release.outputs.tag-name != ''}}
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 }}

0 comments on commit 7e9d233

Please sign in to comment.