Skip to content

Commit aef17f0

Browse files
committed
ADD: publish inside github packages
1 parent 51b271e commit aef17f0

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/docker-image.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,27 @@ jobs:
4242
fail_ci_if_error: true
4343

4444
build:
45-
if: startsWith(github.ref, 'refs/tags/')
45+
#if: startsWith(github.ref, 'refs/tags/')
4646
runs-on: ubuntu-latest
4747
needs: coverage
4848
steps:
4949
- name: Checkout code
5050
uses: actions/checkout@v2
5151
- name: Docker Login
52-
uses: docker/login-action@v2.0.0
52+
uses: docker/login-action@v2.1.0
5353
with:
54-
username: jarpsimoes
55-
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
56-
57-
- name: Add SHORT_SHA env property with commit short sha
58-
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
54+
server: ghcr.io
55+
username: ${{ secrets.DOCKER_REGISTRY_GITHUB_TOKEN }}
56+
password: ${{ secrets.DOCKER_REGISTRY_GITHUB_TOKEN }}
5957

6058
- name: Docker Tag
6159
id: vars
6260
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
6361

6462
- name: Build the Docker image
6563
run: |
66-
docker build . --file Dockerfile --tag jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }}
67-
docker tag jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }} jarpsimoes/git_http_server:latest
64+
docker build . --file Dockerfile --tag ghcr.io/jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }}
6865
6966
- name: Push Image
7067
run: |
71-
docker push jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }}
72-
docker push jarpsimoes/git_http_server:latest
68+
docker push ghcr.io/jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }}

0 commit comments

Comments
 (0)