File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,18 +14,22 @@ jobs:
1414
1515 steps :
1616 - uses : actions/checkout@v2
17-
18- - name : Build an image with a tag
19- run : docker build -t app -f docker/bot.Dockerfile .
17+ - uses : docker/setup-buildx-action@v1
2018
2119 - name : Log into the registry
22- run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
20+ uses : docker/login-action@v1
21+ with :
22+ registry : ghcr.io
23+ username : ${{ github.repository_owner }}
24+ password : ${{ secrets.GITHUB_TOKEN }}
2325
24- - name : Push the image
25- run : |
26- IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
27- VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
28- [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
29- [ "$VERSION" == "master" ] && VERSION=latest
30- docker tag app $IMAGE_ID:$VERSION
31- docker push $IMAGE_ID:$VERSION
26+ - name : Build and push
27+ id : docker_build
28+ uses : docker/build-push-action@v2
29+ with :
30+ context : .
31+ file : docker/bot.Dockerfile
32+ tags : |
33+ ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
34+ ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.event.release.tag_name }}
35+ push : true
You can’t perform that action at this time.
0 commit comments