Skip to content

Make API Container

Make API Container #22

Workflow file for this run

name: Make API Container
on:
workflow_dispatch:
branches: [ main ]
release:
types: [ "published" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Extract tag name based on event type
- name: Extract tag name
id: tag_name
run: |
if [[ $GITHUB_EVENT_NAME == 'release' ]]; then
echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})"
else
echo "##[set-output name=tag;]latest"
fi
shell: bash
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: dustinupdyke/ghosts
tags: dustinupdyke/ghosts:${{ steps.tag_name.outputs.tag }}
push: true
context: src
file: src/Dockerfile-api