CI: publish Docker image to GitHub registry as well 💚
This commit is contained in:
parent
25debd10b6
commit
8ad4336689
1 changed files with 20 additions and 0 deletions
20
.github/workflows/docker-image.yml
vendored
20
.github/workflows/docker-image.yml
vendored
|
@ -17,6 +17,7 @@ jobs:
|
|||
- run: npm install
|
||||
- run: npm run lint
|
||||
- run: npm test
|
||||
|
||||
build-and-publish:
|
||||
name: build & publish Docker image
|
||||
needs: [lint-test]
|
||||
|
@ -36,3 +37,22 @@ jobs:
|
|||
tags: |
|
||||
derhuerst/db-rest:5
|
||||
derhuerst/db-rest:latest
|
||||
|
||||
# this is for the public-transport/infrastructure cluster
|
||||
- name: log in to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: determine commit hash
|
||||
id: hash
|
||||
run: echo "::set-output name=hash::$(echo $GITHUB_SHA | head -c7)"
|
||||
- name: determine current date and time
|
||||
id: datetime
|
||||
run: echo "::set-output name=datetime::$(date -u +'%Y-%m-%dT%H.%M.%SZ')"
|
||||
- name: push Docker image to GitHub Registry
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
tags: ghcr.io/${{github.repository}}:v5_${{steps.hash.outputs.hash}}_${{steps.datetime.outputs.datetime}}
|
||||
|
|
Loading…
Reference in a new issue