Skip to content

Update Dockerfile

Update Dockerfile #4

Workflow file for this run

name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
env:
UPLOAD_IMAGES: true
PUSH_IMAGES: true
RELEASE_IMAGE_TAG: registry.x7.pw/shourturl:latest
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
id: compile
run: |
docker build . --file Dockerfile --tag ${{ env.RELEASE_IMAGE_TAG }}
echo "status=success" >> $GITHUB_OUTPUT
echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
docker save ${{ env.RELEASE_IMAGE_TAG }} > docker.tar
- name: Push images to private regitry
if: steps.compile.outputs.status == 'success' && env.PUSH_IMAGES == 'true'
run: docker push ${{ env.RELEASE_IMAGE_TAG }}
- name: Upload images
uses: actions/upload-artifact@main
if: steps.compile.outputs.status == 'success' && env.UPLOAD_IMAGES == 'true'
with:
name: ShortURL_Images${{ env.FILE_DATE }}
path: docker.tar