1111
1212env :
1313 REGISTRY : ghcr.io
14- API_IMAGE_PATH : ${{ github.repository }}/api
15- WEB_IMAGE_PATH : ${{ github.repository }}/web
14+ API_IMAGE_NAME : api
1615
1716jobs :
1817 api-unit-tests :
4241 - name : " Setup: checkout repository"
4342 uses : actions/checkout@v4
4443
44+ - name : " Setup: Set image name"
45+ run : echo "API_IMAGE=${{ env.REGISTRY }}/${{ github.repository }}/${{ env.API_IMAGE_NAME }}" >> "$GITHUB_ENV"
46+
4547 - name : " Setup: Login to GitHub Container Registry"
4648 uses : docker/login-action@v3
4749 with :
@@ -51,20 +53,16 @@ jobs:
5153
5254 # - name: "Setup: Docker Buildx"
5355 # uses: docker/setup-buildx-action@v3
54- #
55- # - name: "Setup: Build API image"
56- # uses: docker/build-push-action@v6
57- # with:
58- # context: ./api
59- # target: development
60- # load: true
61- # tags: ${{ env.REGISTRY }}/${{ env.API_IMAGE_PATH }}:buildcache
62- # cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.API_IMAGE_PATH }}:buildcache
6356
64- # - name: Build API image
65- # run: |
66- # docker pull $API_IMAGE
67- # docker build --target development --tag api-development ./api # TODO: --cache-from $API_IMAGE
57+ - name : " Setup: Build API image"
58+ uses : docker/build-push-action@v6
59+ with :
60+ context : ./api
61+ target : development
62+ load : true
63+ tags : ${{ env.API_IMAGE }}:dev
64+ cache-from : type=registry,ref=${{ env.API_IMAGE }}:dev
65+ # cache-to: type=registry,ref=${{ env.API_IMAGE }}:dev,mode=max
6866
6967 - name : Pytest Integration tests
7068 run : docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api python -m pytest --integration
@@ -75,23 +73,27 @@ jobs:
7573
7674 web-tests :
7775 runs-on : ubuntu-latest
76+ if : ${{ false }} # disable for now as they do not currently work
7877 steps :
79- - uses : actions/checkout@v4
78+ - name : " Setup: checkout repository"
79+ uses : actions/checkout@v4
8080
81- - name : " Login to GitHub Container Registry"
82- uses : docker/login-action@v3
83- with :
84- registry : ${{ env.REGISTRY }}
85- username : ${{ github.actor }}
86- password : ${{ secrets.GITHUB_TOKEN }}
81+ # - name: "Login to GitHub Container Registry"
82+ # uses: docker/login-action@v3
83+ # with:
84+ # registry: ${{ env.REGISTRY }}
85+ # username: ${{ github.actor }}
86+ # password: ${{ secrets.GITHUB_TOKEN }}
8787
88- - name : Build Web Image
89- run : |
90- docker pull ${REGISTRY}/${WEB_IMAGE_PATH}
91- docker build --cache-from ${REGISTRY}/${WEB_IMAGE_PATH} --target development --tag web-dev ./web
88+ - name : " Setup: Build web image"
89+ uses : docker/build-push-action@v6
90+ with :
91+ context : ./web
92+ target : development
93+ load : true
94+ tags : web:dev
9295
9396 - name : Run Web tests
94- if : ${{ false }} # disable for now as they do not currently work
9597 run : docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web yarn test
9698
9799 docs-tests :
0 commit comments