Skip to content

Commit 928bbce

Browse files
committed
fix cd pipeline
1 parent efc13e0 commit 928bbce

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/cd.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: Tiny-URL-CD-Pipeline
22

33
on:
44
workflow_run:
5-
workflows: ["Tiny-URL-CI-Pipeline"] # must match `name:` in ci.yml
5+
workflows: ["Tiny-URL-CI-Pipeline"]
66
types:
77
- completed
8-
workflow_dispatch:
8+
workflow_dispatch: {}
99

1010
jobs:
1111
build-docker-images:
12-
#if: >
13-
# github.event.workflow_run.conclusion == 'success' &&
14-
#github.event.workflow_run.head_branch == 'main'
12+
if: >
13+
github.event.workflow_run.conclusion == 'success' &&
14+
github.event.workflow_run.head_branch == 'main'
1515
runs-on: ubuntu-latest
1616

1717
steps:
@@ -20,6 +20,10 @@ jobs:
2020

2121
- name: Set up Docker Buildx
2222
uses: docker/setup-buildx-action@v3
23+
with:
24+
driver: docker-container
25+
buildkitd-flags: --debug
26+
use: true
2327

2428
- name: Cache Docker layers
2529
uses: actions/cache@v3
@@ -31,18 +35,20 @@ jobs:
3135
3236
- name: Build API Docker image
3337
run: |
34-
docker build \
38+
docker buildx build \
3539
--file api/Dockerfile \
3640
--tag your-org/tinyurl-api:main \
3741
--cache-from=type=local,src=/tmp/.buildx-cache \
3842
--cache-to=type=local,dest=/tmp/.buildx-cache \
43+
--load \
3944
./api
4045
4146
- name: Build Webapp Docker image
4247
run: |
43-
docker build \
48+
docker buildx build \
4449
--file webapp/Dockerfile \
4550
--tag your-org/tinyurl-webapp:main \
4651
--cache-from=type=local,src=/tmp/.buildx-cache \
4752
--cache-to=type=local,dest=/tmp/.buildx-cache \
53+
--load \
4854
./webapp

0 commit comments

Comments
 (0)