mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-09 08:10:34 +08:00
fixed github actions
This commit is contained in:
parent
78838a943b
commit
252817b7ca
1 changed files with 37 additions and 41 deletions
78
.github/workflows/publish-docker.yml
vendored
78
.github/workflows/publish-docker.yml
vendored
|
|
@ -1,45 +1,41 @@
|
||||||
name: Publish Docker
|
name: Publish Docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'develop'
|
- 'develop'
|
||||||
- 'master'
|
- 'master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Checkout
|
||||||
name: Set Environment Variables
|
uses: actions/checkout@v2
|
||||||
run: |
|
- name: Set up QEMU
|
||||||
echo "BUILD_VER=v0.0.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
|
uses: docker/setup-qemu-action@v1
|
||||||
if ${{ github.head_ref }} = "master" ]
|
- name: Set up Docker Buildx
|
||||||
then
|
uses: docker/setup-buildx-action@v1
|
||||||
echo "TAG=latest" >>$GITHUB_ENV
|
- name: Login to DockerHub
|
||||||
else
|
uses: docker/login-action@v1
|
||||||
echo "TAG=${{ github.head_ref}}" >> $GITHUB_ENV
|
with:
|
||||||
done
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
-
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
name: Checkout
|
- name: Build and push latest
|
||||||
uses: actions/checkout@v2
|
if: github.base_ref == 'master'
|
||||||
-
|
uses: docker/build-push-action@v2
|
||||||
name: Set up QEMU
|
with:
|
||||||
uses: docker/setup-qemu-action@v1
|
context: .
|
||||||
-
|
platforms: linux/amd64, linux/arm64
|
||||||
name: Set up Docker Buildx
|
push: true
|
||||||
uses: docker/setup-buildx-action@v1
|
tags: |
|
||||||
-
|
nusak/netmaker:latest
|
||||||
name: Login to DockerHub
|
- name: Build and push develop
|
||||||
uses: docker/login-action@v1
|
if: github.base_ref == 'develop'
|
||||||
with:
|
uses: docker/build-push-action@v2
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
with:
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
context: .
|
||||||
-
|
platforms: linux/amd64, linux/arm64
|
||||||
name: Build and push
|
push: true
|
||||||
uses: docker/build-push-action@v2
|
tags: |
|
||||||
with:
|
nusak/netmaker:develop
|
||||||
context: .
|
|
||||||
platforms: linux/amd64, linux/arm64
|
|
||||||
push: false
|
|
||||||
tags: |
|
|
||||||
nusak/netmaker:${{ env.TAG }}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue