Compare commits

...

7 Commits

Author SHA1 Message Date
Dave Horton
1c118b171c further refinement 2023-04-10 09:27:28 -04:00
Dave Horton
0cde92798d improve deprecated syntax 2023-04-10 09:20:49 -04:00
Dave Horton
45045fd39b improve deprecated syntax 2023-04-10 09:12:41 -04:00
Dave Horton
92da5518eb try 5 2023-04-10 09:08:54 -04:00
Dave Horton
1126ea827f try 4 2023-04-10 09:02:39 -04:00
Dave Horton
fcc4c0a5ce try 3 2023-04-10 09:00:19 -04:00
Dave Horton
ba3ff42987 try 2 2023-04-10 08:56:44 -04:00

View File

@@ -5,9 +5,6 @@ on:
tags:
- '*'
env:
IMAGE_NAME: feature-server
jobs:
push:
@@ -18,15 +15,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: prepare tag
id: prepare_tag
run: |
IMAGE_ID=jambonz/$IMAGE_NAME
IMAGE_ID=$GITHUB_REPOSITORY
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
@@ -40,12 +32,21 @@ jobs:
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
echo "image_id=$IMAGE_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ IMAGE_ID }}:${{ VERSION }}
tags: ${{ steps.prepare_tag.outputs.image_id }}:${{ steps.prepare_tag.outputs.version }}
build-args: |
GITHUB_REPOSITORY=$GITHUB_REPOSITORY
GITHUB_REF=$GITHUB_REF