Skip to content

Commit

Permalink
Add GitHub action flow for pushting the image to the docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-nu committed Jan 26, 2024
1 parent b28c9a9 commit 022e443
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [FuturePortal, rick-nu]
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Bug report
about: Submit a bug report.
title: ''
labels: 'bug'
assignees: ''
---

# What

Please explain the bug here.

## Reproduction scenario

If applicable, please describe how to reproduce the situation.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Feature request
about: Request a feature.
title: ''
labels: 'feature'
assignees: ''
---

# What

Please explain what you would like.

## Why

Please explain why you would want this feature.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# What

Please explain here what this PR contains.

## Why

Please explain why you want this change in the project.
9 changes: 9 additions & 0 deletions .github/workflows/flow--merge-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: PR codestyle tests
on:
pull_request:
branches:
- production
jobs:
test:
name: Test
uses: ./.github/workflows/job--test-and-lint.yml
19 changes: 19 additions & 0 deletions .github/workflows/flow--new-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build the CIMonitor latest container
on:
push:
branches:
- production
jobs:
test:
name: Test
uses: ./.github/workflows/job--test-and-lint.yml

build:
name: Build
uses: ./.github/workflows/job--build-containers.yml
needs: test
with:
BASE_TAG: latest
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/flow--new-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tag new CIMonitor release
on:
push:
tags:
- '*'
jobs:
test:
name: Test
uses: ./.github/workflows/job--test-and-lint.yml

build:
name: Build
uses: ./.github/workflows/job--build-containers.yml
needs: test
with:
BASE_TAG: ${GITHUB_REF/refs\/tags\//}
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/job--build-containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and tag container
on:
workflow_call:
inputs:
BASE_TAG:
description: The base of the tag to build
required: true
type: string
secrets:
DOCKER_USERNAME:
required: true
DOCKER_TOKEN:
required: true
jobs:
build-and-tag-container:
name: Build & Tag
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Build CIMonitor image
run: docker build --target production --tag rickvdstaaij/move-to-dropbox:latest .

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Push docker image to the hub
run: docker push rickvdstaaij/move-to-dropbox:latest
48 changes: 48 additions & 0 deletions .github/workflows/job--test-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test and lint
on:
workflow_call:
jobs: []
# eslint:
# name: ESLint
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 20
#
# - name: Install development dependencies
# run: yarn install --ignore-scripts
#
# - name: Run eslint check
# run: node_modules/.bin/eslint --ext ts,tsx .
#
# frontend-typescript:
# name: Frontend typescript
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 20
#
# - name: Install development dependencies
# run: yarn install --ignore-scripts
#
# - name: Check frontend typescript
# run: node_modules/.bin/tsc --noEmit --project ./frontend/tsconfig.json
#
# backend-typescript:
# name: Backend typescript
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 20
#
# - name: Install development dependencies
# run: yarn install --ignore-scripts
#
# - name: Check backend typescript
# run: node_modules/.bin/tsc --noEmit --project ./backend/tsconfig.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ docker run \
--env DROPBOX_APP_KEY=redacted \
--env DROPBOX_APP_SECRET=redacted \
--env DROPBOX_REFRESH_TOKEN=redacted \
registry.gitlab.com/futureportal/uploadtodropbox:latest
rickvdstaaij/move-to-dropbox:latest
```

## Running with docker compose
Expand All @@ -47,7 +47,7 @@ version: '3'

services:
dropbox:
image: registry.gitlab.com/futureportal/uploadtodropbox:latest
image: rickvdstaaij/move-to-dropbox:latest
container_name: dropbox-backup-upload
environment:
- DROPBOX_APP_KEY=redacted
Expand Down

0 comments on commit 022e443

Please sign in to comment.