-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
113 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
* | ||
!/core/ | ||
!/pwa/ | ||
!/services/ | ||
!/ui-kit/ | ||
!/uniquely/ | ||
!package.json | ||
!lerna.json | ||
!tsconfig* | ||
!*.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
|
||
name: Publish Containers | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
tags: | ||
- 'v*.*.*' | ||
# branches: | ||
# - next | ||
# - main | ||
|
||
# pull_request: | ||
# paths: | ||
# - 'services/**' | ||
# - '.github/workflows/publish-services.yml' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
USERNAME: ${{github.repository_owner}} | ||
# USERNAME: ${{github.actor}} | ||
# USERNAME: Alwatr | ||
|
||
jobs: | ||
build: | ||
if: github.repository_owner == 'AliMD' | ||
|
||
name: Build & Publish Services | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- image: storage-server | ||
path: services/storage-server | ||
description: Alwatr Storage Server, Elegant micro in-memory json-like storage nanoservice with disk backed, Fastest NoSQL Database. | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
# This is used to complete the identity challenge | ||
# with sigstore/fulcio when running outside of PRs. | ||
# id-token: write | ||
|
||
steps: | ||
- name: ⤵️ Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🏗 Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: 🏗 Log into registry ${{env.REGISTRY}} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USERNAME }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 🏗 Extract metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
images: name=${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ matrix.image }},enable=true | ||
|
||
labels: | | ||
org.opencontainers.image.authors=Ali.Mihandoost@gmail.com | ||
org.opencontainers.image.title=@alwatr/${{matrix.image}} | ||
org.opencontainers.image.description=${{matrix.description}} | ||
tags: | | ||
type=semver,enable=true,pattern={{major}} | ||
type=semver,enable=true,pattern={{major}}.{{minor}} | ||
type=semver,enable=true,pattern={{version}} | ||
type=ref,enable=true,event=pr | ||
type=ref,enable=false,event=branch | ||
- name: 🚀 Build and push container image | ||
id: build-and-push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: ${{github.event_name != 'pull_request'}} | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
tags: ${{steps.meta.outputs.tags}} | ||
labels: ${{steps.meta.outputs.labels}} | ||
context: . | ||
file: ${{matrix.path}}/Dockerfile | ||
# cache-from: type=gha | ||
# cache-to: type=gha,mode=max | ||
|
||
# - name: 🏗 Install cosign | ||
# if: github.event_name != 'pull_request' | ||
# uses: sigstore/cosign-installer@main | ||
|
||
# - name: 🏗 Sign the published container image | ||
# if: ${{github.event_name != 'pull_request'}} | ||
# env: | ||
# COSIGN_EXPERIMENTAL: 'true' | ||
# run: echo "${{steps.meta.outputs.tags}}" | xargs -I {} cosign sign {}@${{steps.build-and-push.outputs.digest}} |