Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
flameshikari committed Sep 6, 2024
1 parent 3c80879 commit d3af59b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 50 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ on:
push:
branches:
- master
- dev
paths:
- .github
- .github/workflows/*
- shared
- src
- Dockerfile
workflow_dispatch:


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
name: Build
Expand All @@ -29,21 +25,23 @@ jobs:
with:
submodules: recursive

- name: Export variable
- name: Extract Version
run: |
echo "VERSION=$(cat src/package.json | jq -r '.version')" >> $GITHUB_ENV
echo "VERSION=$(jq -r '.version' src/package.json)" | tee -a $GITHUB_ENV
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to the GitHub Container Registry
- if: ${{ github.ref == 'refs/heads/master' }}
name: Login to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub
- if: ${{ github.ref == 'refs/heads/master' }}
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
Expand All @@ -54,8 +52,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
${{ env.IMAGE_NAME }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest
type=raw,value=${{ env.VERSION }}
Expand All @@ -65,13 +63,13 @@ jobs:
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
push: ${{ github.ref == 'refs/heads/master' }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags:
${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}

- name: Create Release
- if: ${{ github.ref == 'refs/heads/master' }}
name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.VERSION }}
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/dry_build.yml

This file was deleted.

0 comments on commit d3af59b

Please sign in to comment.