diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml new file mode 100644 index 0000000..2c1c4db --- /dev/null +++ b/.github/workflows/deploy-prod.yml @@ -0,0 +1,40 @@ +# Copyright 2020 ChainSafe Systems +# SPDX-License-Identifier: LGPL-3.0-only + +name: Production Deployment +on: + release: + types: [published] + +jobs: + build: + name: Production Deployment + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + - uses: kciter/aws-ecr-action@v4 + with: + access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + account_id: ${{ secrets.AWS_ACCOUNT_ID }} + region: ${{ secrets.PROD_AWS_REGION }} + repo: ${{ secrets.PROD_ECR_REPOSITORY }} + tags: ${{ github.event.release.tag_name }} + create_repo: false + - run: 'echo "$PROD_HELM_VALUES" > helm/values.yaml' + shell: bash + env: + PROD_HELM_VALUES: ${{secrets.PROD_HELM_VALUES}} + - name: 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.PROD_AWS_REGION }} + - name: helm deploy + uses: koslib/helm-eks-action@master + env: + KUBE_CONFIG_DATA: ${{ secrets.PROD_KUBE_CONFIG_DATA }} + with: + command: helm upgrade --install --create-namespace --namespace ${{ secrets.PROD_KUBE_NAMESPACE }} --set image.tag=${{ github.event.release.tag_name }} -f helm/values.yaml crawler helm/crawler \ No newline at end of file diff --git a/.github/workflows/stage-release.yml b/.github/workflows/deploy-stage.yml similarity index 92% rename from .github/workflows/stage-release.yml rename to .github/workflows/deploy-stage.yml index a90b564..c2ab770 100644 --- a/.github/workflows/stage-release.yml +++ b/.github/workflows/deploy-stage.yml @@ -1,7 +1,7 @@ # Copyright 2020 ChainSafe Systems # SPDX-License-Identifier: LGPL-3.0-only -name: Release Staging +name: Staging Deployment on: push: branches: @@ -9,7 +9,7 @@ on: jobs: build: - name: Release Staging + name: Staging Deployment runs-on: ubuntu-20.04 steps: - name: Checkout code @@ -20,7 +20,7 @@ jobs: secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} account_id: ${{ secrets.AWS_ACCOUNT_ID }} region: ${{ secrets.STAGE_AWS_REGION }} - repo: ${{ secrets.ECR_REPOSITORY }} + repo: ${{ secrets.STAGE_ECR_REPOSITORY }} tags: stage create_repo: false - run: 'echo "$STAGE_HELM_VALUES" > helm/values.yaml' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c38be65 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,16 @@ +# Copyright 2020 ChainSafe Systems +# SPDX-License-Identifier: LGPL-3.0-only + +name: Release +on: + push: + branches: + - main + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + release-type: go \ No newline at end of file