Skip to content

Merge pull request #404 from nationalarchives/update/scalafmt-core-3.8.6 #173

Merge pull request #404 from nationalarchives/update/scalafmt-core-3.8.6

Merge pull request #404 from nationalarchives/update/scalafmt-core-3.8.6 #173

Workflow file for this run

name: DR2 Build Project
on:
push:
branches:
- main
permissions:
id-token: write
contents: write
jobs:
pre-deploy:
runs-on: ubuntu-22.04
outputs:
next-version: ${{ steps.next-tag.outputs.next-version }}
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials from management account
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::${{ secrets.MANAGEMENT_ACCOUNT }}:role/MgmtDPGithubCodeDeploy
aws-region: eu-west-2
role-session-name: GitHubActionsRole
- id: next-tag
uses: nationalarchives/dr2-github-actions/.github/actions/get-next-version@main
with:
repo-name: dr2-ingest
- run: |
rm -rf target/outputs
mkdir -p target/outputs
sbt ingestLambdasRoot/assembly
(cd ./python/lambdas/copy-files-from-tdr/ && bash deploy.sh)
zip -jA copy-files-from-tdr python/lambdas/copy-files-from-tdr/lambda_function.py
zip -jA ingest-cc-notifications python/lambdas/ingest-cc-notifications/cc_notifications/lambda_function.py
cp copy-files-from-tdr ingest-cc-notifications target/outputs
cd target/outputs
aws s3 sync . s3://mgmt-dp-code-deploy/${{ steps.next-tag.outputs.next-version }}/
git tag ${{ steps.next-tag.outputs.next-version }}
git push origin ${{ steps.next-tag.outputs.next-version }}
deploy:
needs: pre-deploy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: gh workflow run deploy.yml -f environment=intg -f to-deploy=${{ needs.pre-deploy.outputs.next-version }}
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}