Skip to content

Commit eec51cf

Browse files
python151emily747
andauthored
Added Docker Hub push step (#43)
Co-authored-by: emily747 <[email protected]>
1 parent 2e6627c commit eec51cf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/api.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,28 @@ jobs:
9797
env:
9898
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_db
9999
run: pnpm test
100+
101+
push:
102+
name: Pushes container to docker container hub
103+
runs-on: ubuntu-latest
104+
steps:
105+
- uses: actions/checkout@v2
106+
107+
- name: Build Image
108+
run: |
109+
cd apps/api/
110+
docker build . --tag events-api
111+
112+
- name: Login to registry
113+
run: echo "${{ secrets.PAT }}" | docker login ghcr.io -u compsoc-service --password-stdin
114+
115+
- name: Push Image
116+
run: |
117+
IMAGE_ID=ghcr.io/compsoc-edinburgh/events-api
118+
docker tag events-api $IMAGE_ID:latest
119+
docker tag events-api $IMAGE_ID:${{ github.sha }}
120+
docker push $IMAGE_ID:${{ github.sha }}
121+
docker push $IMAGE_ID:latest
122+
123+
124+

0 commit comments

Comments
 (0)