Skip to content

Commit

Permalink
ci: Update membrane release workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm committed May 24, 2021
1 parent 9b2bd08 commit befc350
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 60 deletions.
80 changes: 20 additions & 60 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,26 @@
name: Publish Docker images
name: Create Release
on:
release:
types: [published]
pull_request:
types: [closed]
branches:
- 'main'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
version_bump:
name: Bump Version and Create Release
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
token: ${{secrets.GOLANG_TOKEN}}
submodules: recursive
- name: Get Tag
id: tag
run: echo ::set-output name=TAG::$(echo $GITHUB_REF | cut -d / -f 3)
# Setup docker build image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Login to dockerhub
- name: Login to DockerHub
uses: docker/login-action@v1
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Push development image
- name: Push Local Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./plugins/dev/dev.dockerfile
push: true
tags: |
nitricimages/membrane-local:latest
nitricimages/membrane-local:${{ steps.tag.outputs.TAG }}
# Push AWS image
- name: Push AWS Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./plugins/aws/aws.dockerfile
push: true
tags: |
nitricimages/membrane-aws:latest
nitricimages/membrane-aws:${{ steps.tag.outputs.TAG }}
# Push GCP image
- name: Push GCP Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./plugins/gcp/gcp.dockerfile
push: true
tags: |
nitricimages/membrane-gcp:latest
nitricimages/membrane-gcp:${{ steps.tag.outputs.TAG }}
# Push Azure image
- name: Push Azure Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./plugins/azure/azure.dockerfile
push: true
tags: |
nitricimages/membrane-azure:latest
nitricimages/membrane-azure:${{ steps.tag.outputs.TAG }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

66 changes: 66 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release Docker images
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
token: ${{secrets.GOLANG_TOKEN}}
submodules: recursive
- name: Get Tag
id: tag
run: echo ::set-output name=TAG::$(echo $GITHUB_REF | cut -d / -f 3)
# Setup docker build image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Login to dockerhub
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Push development image
- name: Push Local Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./providers/dev/dev.dockerfile
push: true
tags: |
nitricimages/membrane-local:latest
nitricimages/membrane-local:${{ steps.tag.outputs.TAG }}
# Push AWS image
- name: Push AWS Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./providers/aws/aws.dockerfile
push: true
tags: |
nitricimages/membrane-aws:latest
nitricimages/membrane-aws:${{ steps.tag.outputs.TAG }}
# Push GCP image
- name: Push GCP Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./providers/gcp/gcp.dockerfile
push: true
tags: |
nitricimages/membrane-gcp:latest
nitricimages/membrane-gcp:${{ steps.tag.outputs.TAG }}
# Push Azure image
- name: Push Azure Static image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./providers/azure/azure.dockerfile
push: true
tags: |
nitricimages/membrane-azure:latest
nitricimages/membrane-azure:${{ steps.tag.outputs.TAG }}

0 comments on commit befc350

Please sign in to comment.