Skip to content

Commit

Permalink
chore: test api in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
cao7113 committed Jul 8, 2024
1 parent f7cd852 commit a85fd75
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

## enable below??? https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker Try
on:
push:
branches: ["docker"]

permissions:
contents: read

jobs:
test-docker:
runs-on: ubuntu-latest
services:
api-server:
image: cao7113/hello-api-elixir
env:
MIX_ENV: prod
ports:
- 4000:4000

steps:
# - name: Checkout code
# uses: actions/checkout@v4

- name: Ping api-server
run: |
sleep 3
curl http://localhost:4000/ping
curl http://localhost:4000
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ tasks:
## Docker env
dk-builder: docker pull hexpm/elixir:1.17.1-erlang-27.0-debian-bullseye-20240612-slim
dk-runner: docker pull debian:bullseye-20240612-slim
# dockerhub image: https://hub.docker.com/r/cao7113/hello-api-elixir

# Init setup
mk-hello: mix new hello-api-elixir --app hello_api --sup

0 comments on commit a85fd75

Please sign in to comment.