Skip to content

Commit

Permalink
ci: use Docker build action to enable Github caching
Browse files Browse the repository at this point in the history
  • Loading branch information
JSPRH committed Aug 8, 2023
1 parent 230cd3a commit 0f2eba6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/actions/build-and-deploy-api/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ runs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# TODO: publish latest tag somewhere and pull latest container image here to make use of Docker's caching
- name: Build app and container
- name: Build app
run: |
npx nx docker-build api --prod
npx nx build api --prod
shell: bash
- name: Push container to registry
run: |
docker tag api ghcr.io/kordis-leitstelle/kordis/api-${{ inputs.releaseVersion}}
docker push ghcr.io/kordis-leitstelle/kordis/api-${{ inputs.releaseVersion}}
# TODO: Replace wa-deployment by deployment to K8s
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./apps/api/
push: true
tags: ghcr.io/kordis-leitstelle/kordis/api-${{ inputs.releaseVersion}}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy API
id: wa-deployment
uses: azure/webapps-deploy@v2
Expand Down

0 comments on commit 0f2eba6

Please sign in to comment.