Merge pull request #75 from axiomhq/fix-release-name #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
permissions: | |
id-token: write | |
contents: read | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
YQ_VERSION: "4.25.1" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@v3 | |
- run: wget https://github.com/mikefarah/yq/releases/download/v$YQ_VERSION/yq_linux_amd64.tar.gz -O - | tar xz && mv yq_linux_amd64 /usr/local/bin/yq | |
- run: |- | |
mkdir build | |
yq ".Resources.AxiomCloudWatchForwarder.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./forwarder.py)\"" cloudformation-stacks/forwarder.template.yaml > build/axiom-cloudwatch-forwarder-${{ github.ref_name }}-cloudformation-stack.yaml | |
yq ".Resources.SubscriberLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./subscriber.py)\"" cloudformation-stacks/subscriber.template.yaml > build/axiom-cloudwatch-subscriber-${{ github.ref_name }}-cloudformation-stack.yaml | |
yq ".Resources.UnsubscriberLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./unsubscriber.py)\"" cloudformation-stacks/unsubscriber.template.yaml > build/axiom-cloudwatch-unsubscriber-${{ github.ref_name }}-cloudformation-stack.yaml | |
yq ".Resources.ListenerLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./listener.py)\"" cloudformation-stacks/listener.template.yaml > build/axiom-cloudwatch-listener-${{ github.ref_name }}-cloudformation-stack.yaml | |
- 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_prod | |
- name: Release to Production | |
env: | |
SOURCE_DIR: build | |
AWS_S3_BUCKET: "axiom-cloudformation" | |
DEST_DIR: "stacks" | |
run: aws s3 sync --acl public-read ./$SOURCE_DIR s3://$AWS_S3_BUCKET/$DEST_DIR |