mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2026-10-03 01:51:37 +00:00
add: release docker image with latest tag
This commit is contained in:
1 parent
76d9ea1451
commit
77991bbc93
1 file changed
+11
-1
@@ -15,7 +15,17 @@ jobs:
|
|||||||
- name: build
|
- name: build
|
||||||
if: github.event.deleted == false
|
if: github.event.deleted == false
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: ${{ github.repository }}:${{ github.sha }}
|
DOCKER_IMAGE: docker.pkg.github.com/${{ github.repository }}/action:latest
|
||||||
run: |
|
run: |
|
||||||
docker build . --file Dockerfile --tag ${DOCKER_IMAGE} ||
|
docker build . --file Dockerfile --tag ${DOCKER_IMAGE} ||
|
||||||
(echo -e "\e[31m[${GITHUB_WORKFLOW}] failed to build\e[m" && exit 1)
|
(echo -e "\e[31m[${GITHUB_WORKFLOW}] failed to build\e[m" && exit 1)
|
||||||
|
|
||||||
|
- name: push latest image
|
||||||
|
if: success() && endsWith(github.ref, 'master')
|
||||||
|
env:
|
||||||
|
DOCKER_IMAGE: docker.pkg.github.com/${{ github.repository }}/action:latest
|
||||||
|
PKG_GITHUB_TOKEN: ${{ secrets.PKG_GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
echo ${PKG_GITHUB_TOKEN} | docker login docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin &&
|
||||||
|
docker push ${DOCKER_IMAGE} &&
|
||||||
|
docker logout
|
||||||
Reference in new issue
Block a user