Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME_UI: ${{ github.repository }}-ui
IMAGE_NAME_ANSIBLE: ${{ github.repository }}-ansible


jobs:
Expand Down Expand Up @@ -61,22 +62,39 @@ jobs:

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
- name: Extract Docker UI metadata
id: meta-ui
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UI }}

- name: Extract Docker Ansible metadata
id: meta-ansible
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_ANSIBLE }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push UI Docker image
id: build-and-push
id: build-and-push-ui
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: ui/.
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta-ui.outputs.tags }}
labels: ${{ steps.meta-ui.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push Ansible Docker image
id: build-and-push-ansible
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: ansible/.
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-ui.outputs.tags }}
labels: ${{ steps.meta-ui.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -85,12 +103,22 @@ jobs:
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
- name: Sign the published UI Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
TAGS: ${{ steps.meta-ui.outputs.tags }}
DIGEST: ${{ steps.build-and-push-ui.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

- name: Sign the published Ansible Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta-ansible.outputs.tags }}
DIGEST: ${{ steps.build-and-push-ansible.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
6 changes: 3 additions & 3 deletions ansible/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ RUN mkdir /tmp/terraform /root/.ssh && \
unzip terraform_1.12.1_linux_arm64.zip && \
mv terraform /usr/local/bin/

COPY . /simple-stack
COPY . /ansible

WORKDIR /simple-stack
WORKDIR /ansible

RUN pip install --break-system-packages -r requirements.txt

WORKDIR /simple-stack/ansible
WORKDIR /ansible

RUN ansible-galaxy collection install -r requirements.yml -p ./collections

Expand Down
File renamed without changes.