Merge pull request #538 from meshery/dependabot/go_modules/github.com… #258
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
name: Meshery-Operator Build and Releaser | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*' | |
jobs: | |
docker: | |
name: Docker build and push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: Docker login | |
uses: azure/docker-login@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Docker edge build & tag | |
if: startsWith(github.ref, 'refs/tags/') != true && success() | |
run: | | |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest . | |
docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | |
- name: Docker edge push | |
if: startsWith(github.ref, 'refs/tags/') != true && success() | |
run: | | |
docker push ${{ secrets.IMAGE_NAME }}:edge-latest | |
docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | |
- name: Docker stable build & tag | |
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | |
run: | | |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest . | |
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | |
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | |
- name: Docker stable push | |
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | |
run: | | |
docker push ${{ secrets.IMAGE_NAME }}:stable-latest | |
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | |
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | |
# - name: Docker Hub Description | |
# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | |
# uses: peter-evans/[email protected] | |
# env: | |
# DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
# DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
# DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }} |