Skip to content

return if error getting filename #12

return if error getting filename

return if error getting filename #12

Workflow file for this run

name: Build and Push Container Image
on: [push]
env:
IMAGE_NAME: ghcr.io/4armed/kubeshot
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Get version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_SHA} | cut -c1-7)
- name: Build the tagged Docker image
run: docker build . -f build/Dockerfile --tag ${{ env.IMAGE_NAME }}:${{steps.vars.outputs.tag}}
- name: Push the tagged Docker image
run: docker push ${{ env.IMAGE_NAME }}:${{steps.vars.outputs.tag}}
- name: Tag image as latest
run: docker tag ${{ env.IMAGE_NAME }}:${{steps.vars.outputs.tag}} ${{ env.IMAGE_NAME }}:latest
- name: Push latest
run: docker push ${{ env.IMAGE_NAME }}:latest