-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
673 additions
and
673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
name: Build Containers | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
paths: | ||
- "containers/**" | ||
|
||
jobs: | ||
list-containers: | ||
uses: ./.github/workflows/listContainers.yaml | ||
build: | ||
name: Build containers | ||
needs: list-containers | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
container-to-build: ${{fromJson(needs.list-containers.outputs.containers)}} | ||
steps: | ||
- name: Check Out Changes | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Target branch in requirements.txt | ||
working-directory: ./containers/${{matrix.container-to-build}} | ||
run: | | ||
sed 's/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@main/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@${{ github.sha }}/g' requirements.txt > requirements_new.txt && mv requirements_new.txt requirements.txt | ||
- name: Build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./containers/${{matrix.container-to-build}} | ||
push: false | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
"ALERTS_URL=${{secrets.ALERTS_URL}}" | ||
"FHIR_CONNECTOR_URL=${{secrets.FHIRC_CONNECTOR_URL}}" | ||
"INGESTION_URL=${{secrets.INGESTION_URL}}" | ||
"MESSAGE_PARSER_URL=${{secrets.MESSAGE_PARSER_URL}}" | ||
#name: Build Containers | ||
# | ||
#on: | ||
# pull_request: | ||
# branches: | ||
# - "**" | ||
# paths: | ||
# - "containers/**" | ||
# | ||
#jobs: | ||
# list-containers: | ||
# uses: ./.github/workflows/listContainers.yaml | ||
# build: | ||
# name: Build containers | ||
# needs: list-containers | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# container-to-build: ${{fromJson(needs.list-containers.outputs.containers)}} | ||
# steps: | ||
# - name: Check Out Changes | ||
# uses: actions/checkout@v3 | ||
# | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
# | ||
# - name: Target branch in requirements.txt | ||
# working-directory: ./containers/${{matrix.container-to-build}} | ||
# run: | | ||
# sed 's/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@main/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@${{ github.sha }}/g' requirements.txt > requirements_new.txt && mv requirements_new.txt requirements.txt | ||
# | ||
# - name: Build | ||
# uses: docker/build-push-action@v3 | ||
# with: | ||
# context: ./containers/${{matrix.container-to-build}} | ||
# push: false | ||
# cache-from: type=gha | ||
# cache-to: type=gha,mode=max | ||
# build-args: | | ||
# "ALERTS_URL=${{secrets.ALERTS_URL}}" | ||
# "FHIR_CONNECTOR_URL=${{secrets.FHIRC_CONNECTOR_URL}}" | ||
# "INGESTION_URL=${{secrets.INGESTION_URL}}" | ||
# "MESSAGE_PARSER_URL=${{secrets.MESSAGE_PARSER_URL}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,74 @@ | ||
name: Build Release Specific Containers | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
container-tag: | ||
type: string | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
container-tag: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
list-containers: | ||
uses: ./.github/workflows/listContainers.yaml | ||
build: | ||
name: Build containers | ||
needs: list-containers | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
container-to-build: ${{fromJson(needs.list-containers.outputs.containers)}} | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
packages: "write" | ||
steps: | ||
- name: Check Out Changes | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ inputs.container-tag }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
ref: ${{ inputs.container-tag }} | ||
images: ghcr.io/${{ github.repository }}/${{matrix.container-to-build}} | ||
# this sets the version for tags and labels for each of the containers to be | ||
# be the same as the version/tag where the code was pulled from | ||
tags: | | ||
type=semver,pattern={{raw}},value=${{ inputs.container-tag }} | ||
type=ref,event=branch | ||
type=ref,event=tag,pattern={{raw}},value=${{ inputs.container-tag }} | ||
labels: | | ||
org.opencontainers.image.version=${{ inputs.container-tag }} | ||
- name: Target phdi release in requirements.txt | ||
working-directory: ./containers/${{matrix.container-to-build}} | ||
run: | | ||
sed 's/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@main/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@${{ inputs.container-tag }}/g' requirements.txt > requirements_new.txt && mv requirements_new.txt requirements.txt | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./containers/${{matrix.container-to-build}} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
#name: Build Release Specific Containers | ||
# | ||
#on: | ||
# workflow_call: | ||
# inputs: | ||
# container-tag: | ||
# type: string | ||
# required: true | ||
# workflow_dispatch: | ||
# inputs: | ||
# container-tag: | ||
# type: string | ||
# required: true | ||
# | ||
#jobs: | ||
# list-containers: | ||
# uses: ./.github/workflows/listContainers.yaml | ||
# build: | ||
# name: Build containers | ||
# needs: list-containers | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# container-to-build: ${{fromJson(needs.list-containers.outputs.containers)}} | ||
# permissions: | ||
# contents: "read" | ||
# id-token: "write" | ||
# packages: "write" | ||
# steps: | ||
# - name: Check Out Changes | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# ref: ${{ inputs.container-tag }} | ||
# | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
# | ||
# - name: Log in to the Container registry | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# registry: ghcr.io | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
# | ||
# - name: Extract metadata (tags, labels) for Docker | ||
# id: meta | ||
# uses: docker/metadata-action@v4 | ||
# with: | ||
# ref: ${{ inputs.container-tag }} | ||
# images: ghcr.io/${{ github.repository }}/${{matrix.container-to-build}} | ||
# # this sets the version for tags and labels for each of the containers to be | ||
# # be the same as the version/tag where the code was pulled from | ||
# tags: | | ||
# type=semver,pattern={{raw}},value=${{ inputs.container-tag }} | ||
# type=ref,event=branch | ||
# type=ref,event=tag,pattern={{raw}},value=${{ inputs.container-tag }} | ||
# labels: | | ||
# org.opencontainers.image.version=${{ inputs.container-tag }} | ||
# | ||
# - name: Target phdi release in requirements.txt | ||
# working-directory: ./containers/${{matrix.container-to-build}} | ||
# run: | | ||
# sed 's/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@main/phdi @ git+https:\/\/github.com\/CDCgov\/phdi.git@${{ inputs.container-tag }}/g' requirements.txt > requirements_new.txt && mv requirements_new.txt requirements.txt | ||
# | ||
# - name: Build and push | ||
# uses: docker/build-push-action@v3 | ||
# with: | ||
# context: ./containers/${{matrix.container-to-build}} | ||
# push: true | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
# cache-from: type=gha | ||
# cache-to: type=gha,mode=max |
Oops, something went wrong.