2021-04-07 05:44:11 +08:00
|
|
|
name: Publish Docker
|
|
|
|
|
2021-04-09 06:05:07 +08:00
|
|
|
on:
|
2021-04-07 23:30:04 +08:00
|
|
|
pull_request:
|
2021-04-09 06:05:07 +08:00
|
|
|
branches:
|
|
|
|
- 'develop'
|
|
|
|
- 'master'
|
2021-04-12 10:04:21 +08:00
|
|
|
|
2021-04-07 05:44:11 +08:00
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-04-09 06:05:07 +08:00
|
|
|
- name: Checkout
|
2021-04-07 05:44:11 +08:00
|
|
|
uses: actions/checkout@v2
|
2021-04-09 06:05:07 +08:00
|
|
|
- name: Set up QEMU
|
2021-04-07 05:44:11 +08:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2021-04-09 06:05:07 +08:00
|
|
|
- name: Set up Docker Buildx
|
2021-04-07 05:44:11 +08:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2021-04-09 06:05:07 +08:00
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
2021-04-07 05:44:11 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-04-09 06:05:07 +08:00
|
|
|
- name: Build and push latest
|
|
|
|
if: github.base_ref == 'master'
|
2021-04-07 05:44:11 +08:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64, linux/arm64
|
|
|
|
push: true
|
2021-04-07 23:30:04 +08:00
|
|
|
tags: |
|
2021-04-09 06:05:07 +08:00
|
|
|
gravitl/netmaker:latest
|
|
|
|
- name: Build and push develop
|
|
|
|
if: github.base_ref == 'develop'
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64, linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
2021-04-12 10:04:21 +08:00
|
|
|
gravitl/netmaker:develop
|