Skip to content

fix: try out docker image push by tags #157

fix: try out docker image push by tags

fix: try out docker image push by tags #157

Workflow file for this run

name: Build and push Docker image upon release
on:
push:
branches:
- 3.x
- kobenguyent-patch-1
# Build and push Docker images *only* for releases.
release:
types: [published] # , created, edited
jobs:
push_to_registry:
name: Build and push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Genenrate tags
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
TAGS='["codeceptjs/codeceptjs:latest","codeceptjs/codeceptjs:'${GITHUB_REF/refs\/tags\//}'"]'
else
TAGS='["codeceptjs/codeceptjs:latest"]'
fi
echo '::set-output name=tags::'$TAGS
- name: Push to Docker Hub
uses: docker/build-push-action@v1 # Info: https://github.com/docker/build-push-action/tree/releases/v1#tags
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ secrets.DOCKERHUB_REPOSITORY }}
tag_with_ref: true # Info: https://github.com/docker/build-push-action/tree/releases/v1#tag_with_ref
tag_with_sha: true # Info: https://github.com/docker/build-push-action/tree/releases/v1#tag_with_sha
tags: $TAGS