Skip to content

allow ci workflow to upload to ghcr #598

allow ci workflow to upload to ghcr

allow ci workflow to upload to ghcr #598

Workflow file for this run

name: 'CI'
on:
workflow_dispatch:
push:
env:
MEDIA_DOWNLOAD_IMAGE_NAME: ${{ github.repository }}_media-download
GITHUB_REGISTRY: ghcr.io
jobs:
media-download-ci:
permissions:
id-token: write
contents: read
pull-requests: write
packages: write
runs-on: 2core-ubuntu-latest-arm
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build media-download
run: npm run media-download::build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: aws-actions/configure-aws-credentials@v4
name: Configure AWS credentials for pushing to ECR
with:
role-to-assume: ${{ secrets.INVESTIGATIONS_GITHUB_ACTIONS_ROLE_ARN }}
aws-region: eu-west-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push media-download Docker image
uses: docker/build-push-action@v5
with:
context: .
file: containers/media-download.Dockerfile
platforms: linux/arm64
push: true
tags: ${{ env.GITHUB_REGISTRY }}/${{ env.MEDIA_DOWNLOAD_IMAGE_NAME }}:${{ github.ref_name }},${{ secrets.MEDIA_DOWNLOAD_ECR_URI }}:${{ github.ref_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
node_version=20.11.0
ci:
permissions:
id-token: write
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: 'npm'
- name: Install dependencies
run: |
npm install
- name: build API
run: |
npm run api::build
- name: build Client
run: |
npm run client::build
- name: Build output-handler
run: |
npm run output-handler::build
- name: Build worker-capacity-manager
run: |
npm run worker-capacity-manager::build
- name: Build media-download
run: |
npm run media-download::build
- name: Package API/Client/Update
run: |
npm run package
- name: Package Worker
run: |
npm run worker::build
npm run worker::package
- name: CDK synth
run: |
npm run cdk::build
npm run cdk::lint
npm run cdk::synth
- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v4
with:
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
configPath: packages/cdk/riff-raff.yaml
buildNumberOffset: 120
projectName: investigations::transcription-service
contentDirectories: |
cdk.out:
- packages/cdk/cdk.out/TranscriptionService-CODE.template.json
- packages/cdk/cdk.out/TranscriptionService-PROD.template.json
transcription-service-api:
- target/api.zip
transcription-service-output-handler:
- target/output-handler.zip
transcription-service-worker-capacity-manager:
- target/worker-capacity-manager.zip
transcription-service-worker:
- packages/worker/dist/transcription-service-worker_1.0.0_all.deb
- name: Upload repository project to riff-raff
uses: guardian/actions-riff-raff@v4
with:
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
configPath: packages/cdk/riff-raff-repository.yaml
projectName: investigations::transcription-service-repository
contentDirectories: |
cdk.out:
- packages/cdk/cdk.out/TranscriptionServiceRepository.template.json