Skip to content

Commit

Permalink
add github actions for docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
ACHIVX committed May 28, 2024
1 parent 75ea726 commit 7ad1ed3
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/docker-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker build

on:
push:
branches:
- "master"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: achivx/reward-system:master
cache-from: type=gha
cache-to: type=gha,mode=max
36 changes: 36 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release docker build

on:
release:
types: "published"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: achivx/reward-system
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ACHIVX Reward System

[![Docker build](https://github.com/ACHIVX-COM/reward-system/actions/workflows/docker-master.yml/badge.svg)](https://github.com/ACHIVX-COM/reward-system/actions/workflows/docker-master.yml)

This project provides a service that:

- maitains balance of internal tokens (stored in database) and transaction history for each account
Expand Down

0 comments on commit 7ad1ed3

Please sign in to comment.