Skip to content

feat(private-registry): add gitlab-token Composer auth (#51) #356

feat(private-registry): add gitlab-token Composer auth (#51)

feat(private-registry): add gitlab-token Composer auth (#51) #356

Workflow file for this run

name: Build Ansible docker images
on:
schedule:
- cron: "0 12 * * SUN" # every sunday
push:
branches:
- "**"
tags:
- "v*"
pull_request:
branches:
- "master"
jobs:
Ansible:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: lephare/ansible
tags: |
type=schedule,pattern=nightly
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract branch/tag name
id: extract_branch
shell: bash
run: echo "branch=$(echo ${GITHUB_REF/refs\/*\/})" >> $GITHUB_OUTPUT
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
context: docker
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
ANSIBLE_DEPLOY_BRANCH=${{ steps.extract_branch.outputs.branch }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}