Merge pull request #2464 from step-security/ak-remove-tomwillis608-de… #95
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: Cfnrelease-int | |
on: | |
push: | |
branches: | |
- int | |
permissions: # added using https://github.com/step-security/secure-repo | |
contents: read | |
jobs: | |
publish-test: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 | |
with: | |
go-version: 1.17 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@ea7b857d8a33dc2fb4ef5a724500044281b49a5e | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_INT }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_INT }} | |
aws-region: us-west-2 | |
- run: go test ./... -coverpkg=./... | |
env: | |
PAT: ${{ secrets.PAT }} | |
- name: Deploy to AWS CloudFormation | |
uses: aws-actions/aws-cloudformation-github-deploy@72bea2c93ca6be253b71b5966ecde13f9e8af2d4 | |
with: | |
name: secure-workflow-api-ecr | |
template: cloudformation/ecr.yml | |
parameter-overrides: "ResourceName=secure-workflow-api" | |
no-fail-on-empty-changeset: "1" | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@aaf69d68aa3fb14c1d5a6be9ac61fe15b48453a2 | |
- name: Build, tag, and push image to Amazon ECR | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: secure-workflow-api | |
IMAGE_TAG: ${{ github.sha }} | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | |
- name: Deploy to AWS CloudFormation | |
uses: aws-actions/aws-cloudformation-github-deploy@72bea2c93ca6be253b71b5966ecde13f9e8af2d4 | |
with: | |
name: secure-workflow-api | |
template: cloudformation/resources.yml | |
parameter-overrides: >- | |
ResourceName=secure-workflow-api, | |
ImageTag=${{ github.sha }}, | |
PAT=${{ secrets.PAT }} | |
no-fail-on-empty-changeset: "1" | |