Skip to content

Commit

Permalink
Build the ansible deploy image with each build (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
venkytv authored Mar 28, 2022
1 parent 34393cf commit 06fa633
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build-deployer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Ansible deploy image

on:
push:
branches:
- "!*"
tags:
- "*"
workflow_dispatch:

env:
REGISTRY: harbor.mobiledgex.net

jobs:

build-docker-image:
name: Build the ansible deploy docker image
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
-
name: Check out the repo
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
submodules: recursive
fetch-depth: 0
-
name: Compute docker image meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ env.REGISTRY }}/mobiledgex/deploy
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value=nightly
-
name: Set up builder username
run: git config --global user.name github
-
name: Set up docker buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: image=moby/buildkit:v0.9.1
config-inline: |
[worker.oci]
max-parallelism = 4
-
name: Log in to registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Build image
uses: docker/build-push-action@v2
id: build
with:
context: ./edge-cloud-infra/ansible
file: ./edge-cloud-infra/docker/Dockerfile.ansible
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 06fa633

Please sign in to comment.