diff --git a/.github/workflows/build-go.yml b/.github/workflows/build-go.yml index 8c82bc9..572e4ab 100644 --- a/.github/workflows/build-go.yml +++ b/.github/workflows/build-go.yml @@ -2,12 +2,12 @@ name: Go CI on: push: - branches: ["develop", "feature/*", "hotfix/*"] + branches: ['develop', 'feature/*', 'hotfix/*'] paths: - - "cmd/**" - - "pkg/**" - - "package/**" - - ".github/**" + - 'cmd/**' + - 'pkg/**' + - 'package/**' + - '.github/**' workflow_dispatch: permissions: @@ -25,9 +25,9 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout manifest repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: nautible/nautible-app-examples-manifest path: nautible-app-examples-manifest @@ -35,14 +35,23 @@ jobs: # AWS - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + id: login-aws + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/nautible-dev-githubactions-ecr-access-role aws-region: ap-northeast-1 + continue-on-error: true + + - name: login-aws when command failure + run: echo "result - aws login failure" + if: steps.login-aws.outcome == 'failure' + - name: Login to Amazon public ECR id: login-ecr run: | aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/nautible + if: steps.login-aws.outcome == 'success' + - name: examples go Build, tag, and push image to Amazon ECR id: build-image-service-ecr env: @@ -55,19 +64,28 @@ jobs: docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + if: steps.login-aws.outcome == 'success' # Azure - name: Login via Azure CLI - id: login-acr + id: login-azure uses: azure/login@v1 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + continue-on-error: true + + - name: login-azure when command failure + run: echo "result - azure login failure" + if: steps.login-azure.outcome == 'failure' + - name: Login Azure Acr id: login-azure-acr run: | az acr login -n nautibledevacr + if: steps.login-azure.outcome == 'success' + - name: examples go Build, tag, and push image to Azure ACR id: build-image-service-acr env: @@ -79,6 +97,7 @@ jobs: docker build --cache-from=$ACR_REGISTRY/$ACR_REPOSITORY:latest --build-arg CLOUD=azure --build-arg BUILDKIT_INLINE_CACHE=1 -t $ACR_REGISTRY/$ACR_REPOSITORY:latest -t $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG -f ./package/examples/Dockerfile . docker push $ACR_REGISTRY/$ACR_REPOSITORY:latest docker push $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG + if: steps.login-azure.outcome == 'success' - name: update feature branch image tag id: update-feature-branch-image-tag diff --git a/.github/workflows/build-java.yml b/.github/workflows/build-java.yml index e172bb4..03bc2f7 100644 --- a/.github/workflows/build-java.yml +++ b/.github/workflows/build-java.yml @@ -5,7 +5,7 @@ name: Java CI with Maven on: push: - branches: ["develop", "feature/*", "hotfix/*"] + branches: ['develop', 'feature/*', 'hotfix/*'] workflow_dispatch: permissions: @@ -23,19 +23,19 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout manifest repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: nautible/nautible-app-examples-manifest path: nautible-app-examples-manifest token: ${{ secrets.PAT }} - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -45,14 +45,23 @@ jobs: - name: pacakge with Maven for aws run: mvn -B package -Dcloud=aws --file nautible-app-examples-java/pom.xml -Dquarkus.package.type=fast-jar - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + id: login-aws + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/nautible-dev-githubactions-ecr-access-role aws-region: ap-northeast-1 + continue-on-error: true + + - name: login-aws when command failure + run: echo "result - aws login failure" + if: steps.login-aws.outcome == 'failure' + - name: Login to Amazon public ECR id: login-ecr run: | aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/nautible + if: steps.login-aws.outcome == 'success' + - name: examples java Build, tag, and push image to Amazon ECR id: build-image-service-ecr env: @@ -65,6 +74,7 @@ jobs: docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + if: steps.login-aws.outcome == 'success' # Azure - name: pacakge with Maven for Azure @@ -72,16 +82,24 @@ jobs: cd $GITHUB_WORKSPACE mvn -B clean package -Dcloud=azure --file nautible-app-examples-java/pom.xml -Dquarkus.package.type=fast-jar - name: Login via Azure CLI - id: login-acr + id: login-azure uses: azure/login@v1 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + continue-on-error: true + + - name: login-azure when command failure + run: echo "result - azure login failure" + if: steps.login-azure.outcome == 'failure' + - name: Login Azure Acr id: login-azure-acr run: | az acr login -n nautibledevacr + if: steps.login-azure.outcome == 'success' + - name: examples java Build, tag, and push image to Azure ACR id: build-image-service-acr env: @@ -93,6 +111,7 @@ jobs: docker build --cache-from=$ACR_REGISTRY/$ACR_REPOSITORY:latest --build-arg BUILDKIT_INLINE_CACHE=1 -t $ACR_REGISTRY/$ACR_REPOSITORY:latest -t $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG -f ./src/main/docker/Dockerfile.jvm . docker push $ACR_REGISTRY/$ACR_REPOSITORY:latest docker push $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG + if: steps.login-azure.outcome == 'success' - name: update feature branch image tag id: update-feature-branch-image-tag diff --git a/.github/workflows/build-node.yml b/.github/workflows/build-node.yml index cefb6eb..1cc0c11 100644 --- a/.github/workflows/build-node.yml +++ b/.github/workflows/build-node.yml @@ -2,7 +2,7 @@ name: Node CI on: push: - branches: ["develop", "feature/*", "hotfix/*"] + branches: ['develop', 'feature/*', 'hotfix/*'] workflow_dispatch: permissions: @@ -20,9 +20,9 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout manifest repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: nautible/nautible-app-examples-manifest path: nautible-app-examples-manifest @@ -30,14 +30,23 @@ jobs: # AWS - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + id: login-aws + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/nautible-dev-githubactions-ecr-access-role aws-region: ap-northeast-1 + continue-on-error: true + + - name: login-aws when command failure + run: echo "result - aws login failure" + if: steps.login-aws.outcome == 'failure' + - name: Login to Amazon public ECR id: login-ecr run: | aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/nautible + if: steps.login-aws.outcome == 'success' + - name: examples node Build, tag, and push image to Amazon ECR id: build-image-service-ecr env: @@ -50,19 +59,28 @@ jobs: docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + if: steps.login-aws.outcome == 'success' # Azure - name: Login via Azure CLI - id: login-acr + id: login-azure uses: azure/login@v1 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + continue-on-error: true + + - name: login-azure when command failure + run: echo "result - azure login failure" + if: steps.login-azure.outcome == 'failure' + - name: Login Azure Acr id: login-azure-acr run: | az acr login -n nautibledevacr + if: steps.login-azure.outcome == 'success' + - name: examples node Build, tag, and push image to Azure ACR id: build-image-service-acr env: @@ -74,6 +92,7 @@ jobs: docker build --cache-from=$ACR_REGISTRY/$ACR_REPOSITORY:latest --build-arg BUILDKIT_INLINE_CACHE=1 -t $ACR_REGISTRY/$ACR_REPOSITORY:latest -t $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG -f ./docker/Dockerfile . docker push $ACR_REGISTRY/$ACR_REPOSITORY:latest docker push $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG + if: steps.login-azure.outcome == 'success' - name: update feature branch image tag id: update-feature-branch-image-tag diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index 6709979..4d4226e 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -2,7 +2,7 @@ name: Python CI on: push: - branches: ["develop", "feature/*", "hotfix/*"] + branches: ['develop', 'feature/*', 'hotfix/*'] workflow_dispatch: permissions: @@ -20,9 +20,9 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout manifest repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: nautible/nautible-app-examples-manifest path: nautible-app-examples-manifest @@ -30,14 +30,22 @@ jobs: # AWS - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/nautible-dev-githubactions-ecr-access-role aws-region: ap-northeast-1 + continue-on-error: true + + - name: login-aws when command failure + run: echo "result - aws login failure" + if: steps.login-aws.outcome == 'failure' + - name: Login to Amazon public ECR id: login-ecr run: | aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/nautible + if: steps.login-aws.outcome == 'success' + - name: examples python Build, tag, and push image to Amazon ECR id: build-image-service-ecr env: @@ -50,19 +58,28 @@ jobs: docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + if: steps.login-aws.outcome == 'success' # Azure - name: Login via Azure CLI - id: login-acr + id: login-azure uses: azure/login@v1 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + continue-on-error: true + + - name: login-azure when command failure + run: echo "result - azure login failure" + if: steps.login-azure.outcome == 'failure' + - name: Login Azure Acr id: login-azure-acr run: | az acr login -n nautibledevacr + if: steps.login-azure.outcome == 'success' + - name: examples python Build, tag, and push image to Azure ACR id: build-image-service-acr env: @@ -74,6 +91,7 @@ jobs: docker build --cache-from=$ACR_REGISTRY/$ACR_REPOSITORY:latest --build-arg BUILDKIT_INLINE_CACHE=1 -t $ACR_REGISTRY/$ACR_REPOSITORY:latest -t $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG -f ./docker/Dockerfile . docker push $ACR_REGISTRY/$ACR_REPOSITORY:latest docker push $ACR_REGISTRY/$ACR_REPOSITORY:$IMAGE_TAG + if: steps.login-azure.outcome == 'success' - name: update feature branch image tag id: update-feature-branch-image-tag