Ubuntu-Ansible-Setup/.github/workflows/build-docker.yml

44 lines
1020 B
YAML
Raw Normal View History

2023-01-27 14:02:34 -06:00
name: Build Docker Image
on:
2023-01-27 15:01:24 -06:00
workflow_call:
2023-01-27 14:02:34 -06:00
jobs:
build:
runs-on: self-hosted
steps:
2023-02-03 14:18:14 -06:00
- name: clean work directory
uses: AutoModality/action-clean@v1
2023-02-03 13:49:07 -06:00
- name: checkout repo
uses: actions/checkout@v3
2023-02-03 14:37:06 -06:00
with:
path: dev
2023-02-03 14:41:03 -06:00
- name: check files
2023-02-03 14:42:24 -06:00
run: cd dev/
2023-01-27 14:02:34 -06:00
- name: Login To Registry
uses: docker/login-action@v2
with:
registry: "${{ vars.DOCKER_REGISTRY_URL }}"
username: "${{ secrets.DOCKER_REGISTRY_USER }}"
password: "${{ secrets.DOCKER_REGISTRY_PASSWORD }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Ansible Image
uses: docker/build-push-action@v3
with:
2023-02-03 14:37:06 -06:00
context: ./dev
2023-01-27 14:02:34 -06:00
file: ./Dockerfile
push: true
2023-01-27 14:32:00 -06:00
cache-from: type=registry,ref=${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.ansible_container }}:latest
2023-01-27 14:02:34 -06:00
cache-to: type=inline
2023-01-27 14:32:00 -06:00
tags: "${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.ansible_container }}:latest"