generated from meshery/meshery-istio
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from layer5io/ashiscs-patch-5
Fixed #362 Switch to the new Docker Github action in Meshery-maesh repo
- Loading branch information
Showing
1 changed file
with
15 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,43 +113,26 @@ jobs: | |
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: docker login | ||
- name: Docker login | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: actions/docker/login@master # DOCKER_USERNAME & DOCKER_PASSWORD env should be set | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: build docker | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: actions/docker/cli@master | ||
with: | ||
args: "build -t ${{ secrets.IMAGE_NAME }} ." | ||
- name: docker tag with GitHub tag | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
uses: actions/docker/cli@master | ||
uses: azure/container-actions/docker-login@master | ||
with: | ||
args: "tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:${GITHUB_REF:10}" # stripping refs/tags/ | ||
- name: docker tag with GitHub sha | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker build & push | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: actions/docker/cli@master | ||
with: | ||
args: "tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:$GITHUB_SHA" | ||
- name: push docker tag | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }} . | ||
docker tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:$GITHUB_SHA | ||
docker push ${{ secrets.IMAGE_NAME }}:$GITHUB_SHA | ||
docker push ${{ secrets.IMAGE_NAME }}:latest | ||
- name: Docker tag release & push | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
uses: actions/docker/cli@master | ||
with: | ||
args: "push ${{ secrets.IMAGE_NAME }}:${GITHUB_REF:10}" | ||
- name: push docker sha | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: actions/docker/cli@master | ||
with: | ||
args: "push ${{ secrets.IMAGE_NAME }}:$GITHUB_SHA" | ||
- name: push docker latest | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: actions/docker/cli@master | ||
with: | ||
args: "push ${{ secrets.IMAGE_NAME }}:latest" | ||
run: | | ||
docker tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.IMAGE_NAME }}:${GITHUB_REF:10} # stripping refs/tags/ | ||
docker push ${{ secrets.IMAGE_NAME }}:${GITHUB_REF:10} | ||
- name: Docker Hub Description | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: peter-evans/[email protected] | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
|