Skip to content

Commit

Permalink
Merge pull request #50 from nitrictech/feature/publish-workflow
Browse files Browse the repository at this point in the history
Update membrane release workflow.
  • Loading branch information
jyecusch authored May 24, 2021
2 parents 5d4a676 + 6242a06 commit f70daab
Show file tree
Hide file tree
Showing 2 changed files with 96 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 }}

76 changes: 76 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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 }}
# Push Digital Ocean image
- name: Push Digital Ocean image to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./providers/do/do.dockerfile
push: true
tags: |
nitricimages/membrane-do:latest
nitricimages/membrane-do:${{ steps.tag.outputs.TAG }}

0 comments on commit f70daab

Please sign in to comment.