Skip to content

Commit

Permalink
upload zip file to s3
Browse files Browse the repository at this point in the history
  • Loading branch information
SollyzDev committed Sep 30, 2024
1 parent 7feb589 commit 5d4e110
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,33 @@ jobs:
python:
runs-on: ubuntu-latest
outputs:
forwarder: ${{ steps.forwarder-package.outputs.artifact-url }}
forwarder: ${{ steps.forwarder-package.outputs.url }}
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
with:
args: "format --check"
- uses: actions/upload-artifact@v4
id: forwarder-package
with:
name: forwarder.zip
path: src/*
retention-days: 1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_IAM_ROLE }}
role-session-name: release_to_dev
- name: Release to Dev
env:
SOURCE_DIR: src/
AWS_S3_BUCKET: "axiom-cloudformation-dev"
DEST_DIR: "code"
run: aws s3 sync --acl public-read ./$SOURCE_DIR s3://$AWS_S3_BUCKET/$DEST_DIR/axiom-cloudwatch-forwarder-v1.0.zip
- name: Set output
id: forwarder-package
run: echo "url=s3://$AWS_S3_BUCKET/$DEST_DIR/axiom-cloudwatch-forwarder-v1.0.zip" >> "$GITHUB_OUTPUT"
cloudformation:
runs-on: ubuntu-latest
needs:
Expand All @@ -32,10 +46,10 @@ jobs:
- run: echo "${{ needs.python.outputs.forwarder }}"
- run: |-
mkdir build
yq ".Resources.ForwarderLambda.Properties.Code.ZipFile = "${{ needs.python.outputs.forwarder }}" cloudformation-stacks/forwarder.template.yaml > build/axiom-cloudwatch-forwarder-cloudformation-stack.yaml
yq ".Resources.SubscriberLambda.Properties.Code.ZipFile = "${{ needs.python.outputs.forwarder }}" cloudformation-stacks/subscriber.template.yaml > build/axiom-cloudwatch-subscriber-cloudformation-stack.yaml
yq ".Resources.UnsubscriberLambda.Properties.Code.ZipFile = "${{ needs.python.outputs.forwarder }}" cloudformation-stacks/unsubscriber.template.yaml > build/axiom-cloudwatch-unsubscriber-cloudformation-stack.yaml
yq ".Resources.ListenerLambda.Properties.Code.ZipFile = "${{ needs.python.outputs.forwarder }}" cloudformation-stacks/listener.template.yaml > build/axiom-cloudwatch-listener-cloudformation-stack.yaml
yq ".Resources.ForwarderLambda.Properties.Code.ZipFile = \"${{ needs.python.outputs.forwarder }}\" cloudformation-stacks/forwarder.template.yaml > build/axiom-cloudwatch-forwarder-cloudformation-stack.yaml
yq ".Resources.SubscriberLambda.Properties.Code.ZipFile = \"${{ needs.python.outputs.forwarder }}\" cloudformation-stacks/subscriber.template.yaml > build/axiom-cloudwatch-subscriber-cloudformation-stack.yaml
yq ".Resources.UnsubscriberLambda.Properties.Code.ZipFile = \"${{ needs.python.outputs.forwarder }}\" cloudformation-stacks/unsubscriber.template.yaml > build/axiom-cloudwatch-unsubscriber-cloudformation-stack.yaml
yq ".Resources.ListenerLambda.Properties.Code.ZipFile = \"${{ needs.python.outputs.forwarder }}\" cloudformation-stacks/listener.template.yaml > build/axiom-cloudwatch-listener-cloudformation-stack.yaml
- run: cat build/*
- uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 5d4e110

Please sign in to comment.