Skip to content

Commit 0dd9c4e

Browse files
adding docs build jobs, updating version numbers
1 parent 5dcb880 commit 0dd9c4e

File tree

1 file changed

+80
-8
lines changed

1 file changed

+80
-8
lines changed

.github/workflows/ci.yml

Lines changed: 80 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ on:
1616
- 'README.md'
1717
- '.github/**'
1818
- '.dockerignore'
19+
- 'docs/**'
20+
- 'etl/**'
1921
- '.gitignore'
2022
- 'demo**'
2123
- 'go.mod'
@@ -26,7 +28,7 @@ on:
2628
- main
2729

2830
env:
29-
VERSION_NUMBER: 'v1.3.2'
31+
VERSION_NUMBER: 'v1.3.3'
3032
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
3133
AWS_REGION: 'us-west-2'
3234

@@ -53,7 +55,77 @@ jobs:
5355
with:
5456
sarif_file: results.sarif
5557

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+
uses: 'docker/setup-buildx-action@v3.0.0'
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+
uses: 'docker/build-push-action@v5.0.0'
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:
57129
runs-on: ubuntu-22.04
58130
needs: [gosec]
59131
if: needs.gosec.result == 'success'
@@ -83,11 +155,11 @@ jobs:
83155
name: poke-cli
84156
path: /tmp/poke-cli.tar
85157

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:
88160
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'
91163

92164
steps:
93165
- name: Checkout
@@ -116,8 +188,8 @@ jobs:
116188
id-token: 'write'
117189

118190
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'
121193

122194
steps:
123195
- name: Checkout

0 commit comments

Comments
 (0)