Skip to content

Commit

Permalink
Add Docker build GH Actions job
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinqian00 committed Oct 9, 2023
1 parent 3530feb commit 356573d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Docker Build and Deployment

on: push

# on:
# push:
# tags:
# - 'v*.*.*' # Enforce Semantic Versioning

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup CD Environment
uses: yetanalytics/actions/setup-env@v0.0.4

- name: Extract version
id: version
run: echo version=${GITHUB_REF#refs\/tags\/v} >> $GITHUB_OUTPUT

- name: Build bundle
run: make bundle BUNDLE_RUNTIMES=false

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: yetanalytics/persephone

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 356573d

Please sign in to comment.