File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 pull_request :
66
7+ env :
8+ REGISTRY : ghcr.io
9+
710jobs :
811 build :
912 runs-on : ubuntu-latest
13+ permissions :
14+ contents : read # Required for actions/checkout
15+ packages : write # Required to publish docker image
1016
1117 steps :
1218 - name : Checkout code
3440 with :
3541 name : server-app
3642 path : packages/server/dist
43+
44+ - name : Set up Docker Buildx
45+ uses : docker/setup-buildx-action@v3
46+
47+ - name : Log in to GitHub container registry
48+ uses : docker/login-action@v3
49+ with :
50+ registry : ${{ env.REGISTRY }}
51+ username : ${{ github.actor }}
52+ password : ${{ github.token }}
53+
54+ - name : Lowercase the repo name and username as container tags must be lowercase
55+ run : echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
56+
57+ - name : Build and push container image to registry
58+ id : push
59+ uses : docker/build-push-action@v5
60+ with :
61+ push : ${{ github.event_name == 'push' }} # always build the container (incl. Pull Requests), but only push to the registry on code push
62+ tags : ${{ env.REGISTRY }}/${{ env.REPO }}:${{ github.sha }}
63+ file : ./Dockerfile
You can’t perform that action at this time.
0 commit comments