From 79835d2560a06363cd7a199bc6f1c5ce5be22fba Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 29 Sep 2024 18:14:06 -0700 Subject: [PATCH] Building ansible image now --- .gitea/workflows/ansible-builder.yml | 29 ++++++++++++++++++++++++++++ ansible/Dockerfile | 4 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/ansible-builder.yml diff --git a/.gitea/workflows/ansible-builder.yml b/.gitea/workflows/ansible-builder.yml new file mode 100644 index 0000000..9c06d8b --- /dev/null +++ b/.gitea/workflows/ansible-builder.yml @@ -0,0 +1,29 @@ +name: Build Ansible Image +on: + push: + branches: + - master + paths: + - ansible +env: + image: shockrah/ansible + +jobs: + build-ansible-image: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Build docker image + run: docker build -t ${{ env.image }} ${{ gitea.workspace }}/ansible + push-to-docker-hub: + needs: bulid-anisble-image + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + run: | + echo "${{ secrets.dockerhub_pass }}" | \ + docker login -u ${{ secrets.dockerhub_user }} --password-stdin + - name: Push Docker image from previous job + run: docker push ${{ env.image }} + diff --git a/ansible/Dockerfile b/ansible/Dockerfile index 6a66760..2196f99 100644 --- a/ansible/Dockerfile +++ b/ansible/Dockerfile @@ -1,5 +1,5 @@ # Inpsired by William Yeh's Docker image however this one is kept up to date -# with the latest base image versions available +# with the latest base image versions available, and includes ansible-lint FROM alpine:latest @@ -10,7 +10,7 @@ RUN apk --update add sudo python3 openssl ca-certificates openssh-client rsync & python3-dev libffi-dev openssl-dev build-base && \ python3 -m ensurepip && \ pip3 install --upgrade pip cffi && \ - pip3 install ansible && \ + pip3 install ansible ansible-lint && \ apk del build-dependencies && \ rm -rf /var/cache/apk/* && \ mkdir -p /etc/ansible && \