awsdestroy #579
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
cancel: | |
name: 'Cancel Previous Runs' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: styfle/cancel-workflow-action@0.9.0 | |
with: | |
access_token: ${{ github.token }} | |
aws-deploy: | |
name: AWS Deploy | |
runs-on: ubuntu-latest | |
if: github.event.head_commit.message == 'awsdeploy' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Apply changes to aws infrastructure | |
id: build-image | |
env: | |
SERVICE_DIR: infra | |
run: | | |
cd $SERVICE_DIR | |
make depend | |
make deploy | |
aws-destroy: | |
name: AWS Destroy | |
runs-on: ubuntu-latest | |
if: github.event.head_commit.message == 'awsdestroy' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Destroy changes in aws | |
id: build-image | |
env: | |
SERVICE_DIR: infra | |
run: | | |
cd $SERVICE_DIR | |
make depend | |
make destroy | |
aws ecr delete-repository --repository-name eks-cluster/golang-app --force | |
aws ecr delete-repository --repository-name eks-cluster/python-app --force | |
aws ecr delete-repository --repository-name eks-cluster/testbox --force | |
aws ecr delete-repository --repository-name eks-cluster/golang-app-operator --force | |
aws ecr delete-repository --repository-name eks-cluster/goprometheus --force |