netmaker/.github/workflows/publish-docker.yml

43 lines
1.1 KiB
YAML
Raw Normal View History

name: Publish Docker
on:
2021-04-07 23:30:04 +08:00
pull_request:
branches:
- 'develop'
2021-04-07 23:30:04 +08:00
- 'master'
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
-
name: Checkout
uses: actions/checkout@v2
2021-04-07 23:30:04 +08:00
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
2021-04-07 23:30:04 +08:00
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2021-04-07 23:30:04 +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
-
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 }}