mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
use docker/build-push-action@v4
This commit is contained in:
33
.github/workflows/docker-publish.yml
vendored
33
.github/workflows/docker-publish.yml
vendored
@@ -2,13 +2,8 @@ name: Docker
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# Publish `main` as Docker `latest` image.
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
# Publish `v1.2.3` tags as releases.
|
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: feature-server
|
IMAGE_NAME: feature-server
|
||||||
@@ -20,15 +15,16 @@ jobs:
|
|||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build image
|
- name: Login to Docker Hub
|
||||||
run: docker build . --file Dockerfile --tag $IMAGE_NAME
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Log into registry
|
- name: prepare tag
|
||||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
|
||||||
|
|
||||||
- name: Push image
|
|
||||||
run: |
|
run: |
|
||||||
IMAGE_ID=jambonz/$IMAGE_NAME
|
IMAGE_ID=jambonz/$IMAGE_NAME
|
||||||
|
|
||||||
@@ -44,5 +40,12 @@ jobs:
|
|||||||
echo IMAGE_ID=$IMAGE_ID
|
echo IMAGE_ID=$IMAGE_ID
|
||||||
echo VERSION=$VERSION
|
echo VERSION=$VERSION
|
||||||
|
|
||||||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
|
- name: Build and push Docker image
|
||||||
docker push $IMAGE_ID:$VERSION
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: jambonz/$IMAGE_NAME:$VERSION
|
||||||
|
build-args: |
|
||||||
|
GITHUB_REPOSITORY=$GITHUB_REPOSITORY
|
||||||
|
GITHUB_REF=$GITHUB_REF
|
||||||
|
|||||||
Reference in New Issue
Block a user