Skip to content

Commit

Permalink
Merge pull request #23 from cyber-dojo/delete-dead-ci-job
Browse files Browse the repository at this point in the history
Delete dead CI job
  • Loading branch information
JonJagger committed Apr 29, 2024
2 parents 6e37ef4 + aab736d commit 66d2e37
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
59 changes: 29 additions & 30 deletions .github/workflows/sub_deploy_to_beta.yml
Expand Up @@ -41,35 +41,35 @@ jobs:
echo "aws_region=eu-central-1" >> ${GITHUB_OUTPUT}
echo "gh_actions_iam_role_name=gh_actions_services" >> ${GITHUB_OUTPUT}
push-image-to-beta-ecr:
needs: [variables]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ needs.variables.outputs.aws_region }}
role-duration-seconds: 2400
role-session-name: ${{ github.event.repository.name }}
role-to-assume: arn:aws:iam::${{ needs.variables.outputs.aws_account_id }}:role/${{ needs.variables.outputs.gh_actions_iam_role_name }}

- name: Login to Amazon ECR (Elastic Container Registry)
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Push image to private beta-ECR
run: |
PUBLIC_IMAGE_NAME=cyberdojo/${{ needs.variables.outputs.service_name }}:${{ inputs.IMAGE_TAG }}
PRIVATE_IMAGE_NAME=${{ needs.variables.outputs.ecr_registry }}/${{ needs.variables.outputs.service_name }}:${{ inputs.IMAGE_TAG }}
docker pull ${PUBLIC_IMAGE_NAME}
docker tag ${PUBLIC_IMAGE_NAME} ${PRIVATE_IMAGE_NAME}
docker push ${PRIVATE_IMAGE_NAME}
# push-image-to-beta-ecr:
# needs: [variables]
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: write
# steps:
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-region: ${{ needs.variables.outputs.aws_region }}
# role-duration-seconds: 2400
# role-session-name: ${{ github.event.repository.name }}
# role-to-assume: arn:aws:iam::${{ needs.variables.outputs.aws_account_id }}:role/${{ needs.variables.outputs.gh_actions_iam_role_name }}
#
# - name: Login to Amazon ECR (Elastic Container Registry)
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
#
# - name: Push image to private beta-ECR
# run: |
# PUBLIC_IMAGE_NAME=cyberdojo/${{ needs.variables.outputs.service_name }}:${{ inputs.IMAGE_TAG }}
# PRIVATE_IMAGE_NAME=${{ needs.variables.outputs.ecr_registry }}/${{ needs.variables.outputs.service_name }}:${{ inputs.IMAGE_TAG }}
# docker pull ${PUBLIC_IMAGE_NAME}
# docker tag ${PUBLIC_IMAGE_NAME} ${PRIVATE_IMAGE_NAME}
# docker push ${PRIVATE_IMAGE_NAME}

deploy-to-aws-beta:
needs: [variables, push-image-to-beta-ecr]
needs: [variables]
permissions:
id-token: write
contents: write
Expand All @@ -91,15 +91,14 @@ jobs:
# tf_state_file_name: "${{ needs.variables.outputs.service_name }}.tfstate"

trail-attest-terraform:
needs: deploy-to-aws-beta
if: false # WIP
needs: [deploy-to-aws-beta]
permissions:
actions: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: Setup kosli cli
uses: kosli-dev/setup-cli-action@v2
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/sub_deploy_to_prod.yml
Expand Up @@ -64,15 +64,14 @@ jobs:
# tf_state_file_name: "${{ needs.variables.outputs.service_name }}.tfstate"

trail-attest-terraform:
needs: deploy-to-aws-prod
if: false # WIP
needs: [deploy-to-aws-prod]
permissions:
actions: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: Setup kosli cli
uses: kosli-dev/setup-cli-action@v2
Expand Down

0 comments on commit 66d2e37

Please sign in to comment.