Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Hub container upload automation using GitHub Actions #111

Merged
merged 6 commits into from
Jan 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker Image CI

on:
push:
BitFis marked this conversation as resolved.
Show resolved Hide resolved
tags:
- 'v*'

jobs:

build_and_push_latest:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker-compose latest
run: GITHUB_API_TOKEN='${{ secrets.GITHUB_TOKEN }}' docker-compose build
- name: Push latest image
run: GITHUB_API_TOKEN='${{ secrets.GITHUB_TOKEN }}' docker-compose build
BitFis marked this conversation as resolved.
Show resolved Hide resolved
- name: Build docker-compose tag
run: GITHUB_API_TOKEN='${{ secrets.GITHUB_TOKEN }}' GROCY_IMAGE_TAG="$(git describe --abbrev=0 --tags)" docker-compose build
BitFis marked this conversation as resolved.
Show resolved Hide resolved
- name: Push tag
run: docker-compose push
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '2.4'
services:

nginx:
image: "grocy/nginx:v3.0.0-1"
image: "grocy/nginx:${GROCY_IMAGE_TAG:-latest}"
build:
args:
GROCY_VERSION: v3.0.0
BitFis marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -22,7 +22,7 @@ services:
container_name: nginx

grocy:
image: "grocy/grocy:v3.0.0-1"
image: "grocy/grocy:${GROCY_IMAGE_TAG:-latest}"
build:
args:
GITHUB_API_TOKEN: "${GITHUB_API_TOKEN}"
Expand Down