-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build the ansible deploy image with each build (#5)
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |