2021-04-07 05:44:11 +08:00
|
|
|
name: Publish Docker
|
|
|
|
|
|
|
|
on:
|
2021-04-07 23:30:04 +08:00
|
|
|
pull_request:
|
2021-04-07 05:44:11 +08:00
|
|
|
branches:
|
|
|
|
- 'develop'
|
2021-04-07 23:30:04 +08:00
|
|
|
- 'master'
|
2021-04-07 05:44:11 +08:00
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-04-07 23:30:04 +08:00
|
|
|
- uses: FranzDiebold/github-env-vars-action@v2
|
|
|
|
- name: Set Environment Variables
|
|
|
|
run: |
|
|
|
|
echo "BUILD_VER=v0.0.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
|
|
|
|
-
|
2021-04-07 05:44:11 +08:00
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-04-07 23:30:04 +08:00
|
|
|
-
|
2021-04-07 05:44:11 +08:00
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
2021-04-07 23:30:04 +08:00
|
|
|
-
|
2021-04-07 05:44:11 +08:00
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
2021-04-07 23:30:04 +08:00
|
|
|
-
|
2021-04-07 05:44:11 +08:00
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-04-07 23:30:04 +08:00
|
|
|
-
|
2021-04-07 05:44:11 +08:00
|
|
|
name: Build and push
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64, linux/arm64
|
|
|
|
push: true
|
2021-04-07 23:30:04 +08:00
|
|
|
tags: |
|
|
|
|
gravitl/netmaker:${{ env.CI_REF_NAME_SLUG }}
|
|
|
|
gravitl/netmaker:${{ env.BUILD_VER }}
|
|
|
|
|
|
|
|
|