Skip to content

Commit

Permalink
Feature/cdpt pr 1855 build step (#293)
Browse files Browse the repository at this point in the history
* Update design system file to authenticate and copy files
Tested locally and was able to copy over successfully

* Typo

* Typo
  • Loading branch information
EmilyHazlehurst authored Dec 6, 2024
1 parent 0989779 commit 29d8b79
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/design-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,27 @@ jobs:
shell: bash
run: npm run build-storybook

- name: "Configuring AWS credentials"
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.S3_ROLE_TO_ASSUME }}
role-session-name: "justice-gov-uk-design-system-${{ github.run_number }}"
aws-region: "eu-west-2"
- name: "Authenticate to the cluster"
env:
KUBE_CERT: ${{ secrets.KUBE_CERT }}
KUBE_TOKEN: ${{ secrets.KUBE_TOKEN }}
KUBE_CLUSTER: ${{ secrets.KUBE_CLUSTER }}
run: |
echo "${KUBE_CERT}" > ca.crt
kubectl config set-cluster ${KUBE_CLUSTER} --certificate-authority=./ca.crt --server=https://${KUBE_CLUSTER}
kubectl config set-credentials deploy-user --token=${KUBE_TOKEN}
kubectl config set-context ${KUBE_CLUSTER} --cluster=${KUBE_CLUSTER} --user=deploy-user --namespace=${KUBE_NAMESPACE}
kubectl config use-context ${KUBE_CLUSTER}
- name: "Copy files to service pod"
env:
SERVICE_POD: ${{ secrets.SERVICE_POD }}
run: |
kubectl -n ${KUBE_NAMESPACE} cp ./public/app/frontend/storybook-static ${SERVICE_POD}:/tmp/storybook-static
- name: Deploy to S3
shell: bash
run: aws s3 sync ./public/app/frontend/storybook-static s3://$AWS_S3_BUCKET --follow-symlinks --delete
- name: "Sync to S3"
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
SERVICE_POD: ${{ secrets.SERVICE_POD }}
run: |
kubectl -n ${KUBE_NAMESPACE} exec -it pod/${SERVICE_POD} -- aws s3 sync /tmp/storybook-static s3://${AWS_S3_BUCKET} --follow-symlinks --delete

0 comments on commit 29d8b79

Please sign in to comment.