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

Implement Docker publish pipeline #66

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
35 changes: 35 additions & 0 deletions .github/workflows/check-package-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check if package version is updated

on:
pull_request:
branches:
- master
jobs:
start:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup NodeJS
uses: "actions/setup-node@v3"
with:
node-version: 18.15

- name: Check if version has been updated
id: check
uses: EndBug/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-name: ./backend/package.json

- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Yayy!! Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'

- name: Dry run Skandha build
run: yarn install && yarn build && yarn run bootstrap

- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: echo "No version change :/ Please update version in package.json!" && exit 1
38 changes: 37 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Trigger Pipeline
name: Build Arka docker image

on:
push:
Expand All @@ -13,5 +13,41 @@ jobs:
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Get Arka backend package version
id: get_version
run: echo version=$(node -p "require('./backend/package.json').version") >> $GITHUB_OUTPUT
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: ./backend
platforms: linux/amd64,linux/arm64
file: ./backend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/arka:${{ steps.get_version.outputs.version }}
${{ secrets.DOCKERHUB_USERNAME }}/arka:latest
-
name: Create GitHub release
uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.get_version.outputs.version }}
prerelease: false
title: Release ${{ steps.get_version.outputs.version }}
-
name: Trigger pipeline
run: ${{ secrets.PIPELINE_TRIGGER }}
Loading