|
16 | 16 | - 'README.md' |
17 | 17 | - '.github/**' |
18 | 18 | - '.dockerignore' |
| 19 | + - 'docs/**' |
| 20 | + - 'etl/**' |
19 | 21 | - '.gitignore' |
20 | 22 | - 'demo**' |
21 | 23 | - 'go.mod' |
|
26 | 28 | - main |
27 | 29 |
|
28 | 30 | env: |
29 | | - VERSION_NUMBER: 'v1.3.2' |
| 31 | + VERSION_NUMBER: 'v1.3.3' |
30 | 32 | DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli' |
31 | 33 | AWS_REGION: 'us-west-2' |
32 | 34 |
|
|
53 | 55 | with: |
54 | 56 | sarif_file: results.sarif |
55 | 57 |
|
56 | | - build-docker-image: |
| 58 | + build-docs-docker-image: |
| 59 | + runs-on: ubuntu-22.04 |
| 60 | + needs: [ gosec ] |
| 61 | + if: needs.gosec.result == 'success' |
| 62 | + |
| 63 | + steps: |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + sparse-checkout: | |
| 68 | + docs |
| 69 | +
|
| 70 | + - name: Set up Docker Buildx |
| 71 | + |
| 72 | + |
| 73 | + - name: Prepare Docker Build Context |
| 74 | + run: | |
| 75 | + mkdir docker-context |
| 76 | + rsync -av --exclude=docker-context . docker-context/ |
| 77 | +
|
| 78 | + - name: Build and Export |
| 79 | + |
| 80 | + with: |
| 81 | + context: ./docker-context |
| 82 | + file: ./docker-context/docs/Dockerfile |
| 83 | + tags: docs:latest |
| 84 | + outputs: type=docker,dest=/tmp/docs.tar |
| 85 | + |
| 86 | + - name: Upload Artifact |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: docs |
| 90 | + path: /tmp/docs.tar |
| 91 | + |
| 92 | + upload-docs-to-ecr: |
| 93 | + runs-on: ubuntu-22.04 |
| 94 | + needs: [build-docs-docker-image] |
| 95 | + if: needs.build-docs-docker-image.result == 'success' |
| 96 | + |
| 97 | + steps: |
| 98 | + - name: Checkout |
| 99 | + uses: actions/checkout@v4 |
| 100 | + |
| 101 | + - name: Configure AWS |
| 102 | + uses: aws-actions/configure-aws-credentials@v4 |
| 103 | + with: |
| 104 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 105 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 106 | + aws-region: ${{ env.AWS_REGION }} |
| 107 | + |
| 108 | + - name: Login to Amazon ECR |
| 109 | + id: login-ecr |
| 110 | + uses: aws-actions/amazon-ecr-login@v2 |
| 111 | + |
| 112 | + - name: Download Artifact |
| 113 | + uses: actions/download-artifact@v4 |
| 114 | + with: |
| 115 | + name: docs |
| 116 | + path: /tmp |
| 117 | + |
| 118 | + - name: Load Image |
| 119 | + run: docker load -i /tmp/docs.tar |
| 120 | + |
| 121 | + - name: Tag and Push |
| 122 | + run: | |
| 123 | + docker tag docs:latest ${{ secrets.AWS_DOCS_ECR_NAME }}:latest |
| 124 | + docker push ${{ secrets.AWS_DOCS_ECR_NAME }}:latest |
| 125 | +
|
| 126 | + # AWS will then take care of updating App Runner with the latest version |
| 127 | + |
| 128 | + build-cli-docker-image: |
57 | 129 | runs-on: ubuntu-22.04 |
58 | 130 | needs: [gosec] |
59 | 131 | if: needs.gosec.result == 'success' |
@@ -83,11 +155,11 @@ jobs: |
83 | 155 | name: poke-cli |
84 | 156 | path: /tmp/poke-cli.tar |
85 | 157 |
|
86 | | - # Uploading to Elastic Container Registry has a backup method. |
87 | | - upload-to-ecr: |
| 158 | + # Uploading to Elastic Container Registry as a backup method. |
| 159 | + upload-cli-to-ecr: |
88 | 160 | runs-on: ubuntu-22.04 |
89 | | - needs: [build-docker-image] |
90 | | - if: needs.build-docker-image.result == 'success' |
| 161 | + needs: [build-cli-docker-image] |
| 162 | + if: needs.build-cli-docker-image.result == 'success' |
91 | 163 |
|
92 | 164 | steps: |
93 | 165 | - name: Checkout |
@@ -116,8 +188,8 @@ jobs: |
116 | 188 | id-token: 'write' |
117 | 189 |
|
118 | 190 | runs-on: ubuntu-22.04 |
119 | | - needs: [build-docker-image] |
120 | | - if: needs.build-docker-image.result == 'success' |
| 191 | + needs: [build-cli-docker-image] |
| 192 | + if: needs.build-cli-docker-image.result == 'success' |
121 | 193 |
|
122 | 194 | steps: |
123 | 195 | - name: Checkout |
|
0 commit comments