Skip to content

Commit

Permalink
Re-enabled build-and-test in feature branch.
Browse files Browse the repository at this point in the history
Moved docker build to main.
  • Loading branch information
harmen-xb committed Nov 25, 2024
1 parent 8c23ecb commit 5299a04
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 45 deletions.
47 changes: 2 additions & 45 deletions .github/workflows/cicd-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,5 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
#build-and-test:
# uses: ./.github/workflows/build-and-test.yml

docker:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- 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
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
build-and-test:
uses: ./.github/workflows/build-and-test.yml
45 changes: 45 additions & 0 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml

# Publish a test report using the playwright result files published in the previous step (execute in Linux only).
publish-playwright-test-report:
name: Publish PlayWright Test Report
Expand Down Expand Up @@ -60,3 +61,47 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

# Create Docker image with CrossModel web application.
docker:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- 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
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit 5299a04

Please sign in to comment.