created github workflow for dev image

This commit is contained in:
Christopher Bisset 2022-06-29 08:41:47 +10:00
parent b3b87a74ab
commit f1a33efd63

43
.github/workflows/publish-image.yaml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Publish Image
on:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Variable Gathering
id: gathervars
run: |
# get a current BUILD_DATE
echo "::set-output name=BUILD_DATE::$(date +%Y%m%d-%H%M%S)"
# set version based on BUILD_DATE
echo "::set-output name=VERSION::$(date +%Y.%m.%d)-1"
- name: Checkout Repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker Image
uses: docker/build-push-action@v2
with:
build-args: |
BUILD_DATE=${{ steps.gathervars.outputs.BUILD_DATE }}
VERSION=${{ steps.gathervars.outputs.VERSION }}
context: ./docker/development
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.gathervars.outputs.VERSION }}
push: true