Skip to content

v4.0.0

v4.0.0 #7

Workflow file for this run

name: Release
on:
release:
types:
- created
workflow_dispatch:
env:
IMAGE_NAME: lewislbr/gss
jobs:
build-release:
name: Build and push the Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Get git tag
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: Build image
run: DOCKER_BUILDKIT=1 docker build -t "$IMAGE_NAME":"$GIT_TAG" -t "$IMAGE_NAME":latest --target=prod .
- name: Log in
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push image
run: docker push "$IMAGE_NAME":"$GIT_TAG" && docker push "$IMAGE_NAME":latest