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
12 changes: 5 additions & 7 deletions .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous Deployment to Staging
name: Continuous Deployment of Master

on:
push:
Expand All @@ -9,9 +9,7 @@ jobs:
uses: ./.github/workflows/docker-build-push.yml
with:
push: true
tags: dticarriage/carriage-service:latest
registry: docker.io
secrets:
inherit: true
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }}
secrets: inherit
14 changes: 3 additions & 11 deletions .github/workflows/ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@ on: pull_request

jobs:
build:
permissions:
contents: read
packages: write

uses: ./.github/workflows/docker-build-push.yml
with:
push: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
tags: |
ghcr.io/${{ github.repository }}/pr-${{ github.event.pull_request.number }}:latest
ghcr.io/${{ github.repository }}/pr-${{ github.event.pull_request.number }}:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:pr-${{ github.event.pull_request.number }}-latest
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
labels: |
org.opencontainers.image.source=${{ github.event.pull_request.html_url }}
org.opencontainers.image.title=PR-${{ github.event.pull_request.number }}
org.opencontainers.image.description=${{ github.event.pull_request.title }}
registry: ghcr.io
secrets:
inherit: true
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
secrets: inherit
22 changes: 8 additions & 14 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Docker Build and Push
# must be run with `secrets: inherit` to ensure secrets are given

on:
workflow_call:
Expand All @@ -16,17 +17,10 @@ on:
required: false
default: ''
type: string
registry:
description: 'Registry URL (optional)'
required: false
type: string
secrets:
username:
description: 'Registry password (optional)'
required: false
password:
description: 'Registry password (optional)'
required: false

permissions:
contents: write
packages: write

jobs:
build:
Expand All @@ -42,9 +36,9 @@ jobs:
- name: Log in to registry
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ services:
- REACT_APP_ENCRYPTION_KEY=${REACT_APP_ENCRYPTION_KEY}
ports:
- '3001:3001'
image: dticarriage/carriage-service:latest
image: ghcr.io/cornell-dti/carriage-web:${IMAGE_TAG:-latest}
restart: always
Loading