Skip to content

Build Containers

Build Containers #4

# build all container files in this repository & push it to GHCR
name: Build Containers
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ansible
uses: docker/build-push-action@v2
with:
context: ./ansible
file: ./ansible/Dockerfile
# platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/ansible:latest
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./ansible-playbook
file: ./ansible-playbook/Dockerfile
# platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/ansible-playbook:latest