Skip to content

Commit

Permalink
Add github workflow to build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellrr committed Jan 25, 2024
1 parent 62913f9 commit b5fd473
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/docker_build_management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Push Docker Edge-k8s Management Image

on:
push:
branches:
- main
paths:
- 'Dockerfile'
pull_request:
branches:
- main
paths:
- 'Dockerfile'
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push management image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/edgek8s-provision:latest
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Note: Your host & the host you're deploying talos on needs to be able to reach e

Make sure to change the value of the variable ```controlplane_ips``` (playbooks/roles/talos-provision/vars/main.yml) to the IP of the host talos is being deployed to, multiple hosts are currently not supported.

```docker run -it -v /Users/danielr/work/k8s-edge-infra:/k8s-edge-infra danielrcode/edge-k8s-ansible-provision:latest /bin/sh -c "cd k8s-edge-infra && ansible-playbook playbooks/edgek8s-complete-provision.yml"```
```docker run -it -v /Users/danielr/work/k8s-edge-infra:/k8s-edge-infra eficode-academy/edgek8s-provision:latest /bin/sh -c "cd k8s-edge-infra && ansible-playbook playbooks/edgek8s-complete-provision.yml"```

Make sure that the path to the repo is correct in the volume mounted, change the left part (by the -v flag in the docker command) of the path to match the path to the repo on your localhost.

Expand Down

0 comments on commit b5fd473

Please sign in to comment.