added ci for docker builds
This commit is contained in:
parent
98e7c6e920
commit
83ab75a11d
1 changed files with 31 additions and 0 deletions
31
.github/workflows/docker-autobuild.yml
vendored
Executable file
31
.github/workflows/docker-autobuild.yml
vendored
Executable file
|
@ -0,0 +1,31 @@
|
|||
name: Docker Image CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
|
||||
build-upload:
|
||||
name: Build Image and Upload to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Build and Upload
|
||||
env:
|
||||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||||
run: |
|
||||
# Variables
|
||||
TAG=$(date +%y.%m)
|
||||
NAME=silentdigit/letsencrypt
|
||||
|
||||
# Build image
|
||||
docker build --tag ${NAME}:${TAG} .
|
||||
|
||||
# Push image as current version
|
||||
docker login -u silentdigit -p ${DOCKER_TOKEN}
|
||||
docker push ${NAME}:${TAG}
|
||||
|
||||
# Push image as latest
|
||||
docker tag ${NAME}:${TAG} ${NAME}:latest
|
||||
docker push ${NAME}:latest
|
Loading…
Reference in a new issue