-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add build-containers workflow * move around action files * another try * crossed fingers
- Loading branch information
1 parent
581f6cf
commit 53774d6
Showing
7 changed files
with
201 additions
and
279 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Build containers | ||
on: | ||
workflow_call: | ||
secrets: | ||
username: | ||
required: true | ||
description: "Username value for container repository" | ||
password: | ||
required: true | ||
description: "Password/token value for container repository" | ||
registry: | ||
required: false | ||
description: "URL for container repository (default: DockerHub)" | ||
inputs: | ||
tag: | ||
type: string | ||
required: true | ||
description: "Version identifier for release" | ||
services: | ||
type: string | ||
required: true | ||
description: "Stringified JSON array of which service containers to build" | ||
default: '["rails","sidekiq","fcrepo","solr","fits_servlet"]' | ||
environments: | ||
type: string | ||
required: true | ||
description: Stringified JSON array of GitHub environments to use for variables | ||
default: '["stage","production"]' | ||
|
||
jobs: | ||
build_containers: | ||
name: Build containers | ||
runs-on: ubuntu-latest | ||
environment: ${{ matrix.environment }} | ||
strategy: | ||
matrix: | ||
environment: ${{ fromJson(inputs.environments) }} | ||
service: | ||
- | ||
name: rails | ||
image: lafayette/rails | ||
context: . | ||
target: spot-web-production | ||
- | ||
name: sidekiq | ||
image: lafayette/sidekiq | ||
context: . | ||
target: spot-worker-production | ||
- | ||
name: solr | ||
image: lafayette/solr | ||
context: ./docker/solr | ||
- | ||
name: fcrepo | ||
image: lafayette/fc | ||
context: ./docker/fcrepo | ||
- | ||
name: fits_servlet | ||
image: lafayette/fits_servlet | ||
context: ./docker/fits_servlet | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- | ||
name: Log into Docker | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ secrets.registry || 'docker.io' }} | ||
username: ${{ secrets.username }} | ||
password: ${{ secrets.password }} | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Build and push ${{ matrix.service.image }} container | ||
uses: ./.github/actions/build-container | ||
if: ${{ contains(fromJson(inputs.services), matrix.service.name) }} | ||
with: | ||
registry: ${{ secrets.registry || 'docker.io' }} | ||
tag: ${{ inputs.tag }} | ||
image_name: ${{ matrix.service.image }} | ||
context: ${{ matrix.service.context }} | ||
target: ${{ matrix.service.target }} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build development containers | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- refactor-actions # remove this before merging! | ||
|
||
release: | ||
types: | ||
- prereleased | ||
|
||
permissions: | ||
checks: write | ||
|
||
jobs: | ||
lint_and_test: | ||
name: Lint + Test | ||
uses: ./.github/workflows/lint-and-test.yml | ||
|
||
build_and_push_development_containers: | ||
name: Build and push dev containers | ||
uses: ./.github/workflows/build-containers.yml | ||
needs: [lint_and_test] | ||
secrets: | ||
registry: ${{ secrets.CONTAINER_REGISTRY }} | ||
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | ||
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} | ||
with: | ||
tag: ${{ github.event.release.tag_name || github.ref_name }} | ||
environments: '["stage"]' | ||
services: '["rails","sidekiq","fcrepo","solr","fits_servlet"]' | ||
|
Oops, something went wrong.