Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed May 4, 2023
1 parent b8f31e9 commit 13b0b6b
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: release

on:
push:
tags:
- v*.*.*
branches-ignore:
- '**'

jobs:
build-images:
name: Build Images
runs-on: ubuntu-latest
strategy:
matrix:
component:
- ns-builder
- ns-controller
- ns-gateway
- ns-migrate
- ns-ssgen
steps:
- uses: actions/checkout@v3
- name: Set APP_VERSION env
run: echo "APP_VERSION=$(echo ${GITHUB_REF:11})" >> $GITHUB_ENV
- name: Set APP_REVISION env
run: echo "APP_REVISION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: traptitech
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: docker/build-push-action@v4
with:
context: .
target: ${{ matrix.component }}
platforms: linux/amd64,linux/arm64
push: true
build-args: |
APP_VERSION=${{ env.APP_VERSION }}
APP_REVISION=${{ env.APP_REVISION }}
tags: |
ghcr.io/traptitech/${{ matrix.component }}:latest
ghcr.io/traptitech/${{ matrix.component }}:${{ env.APP_VERSION }}
cache-from: type=registry,ref=ghcr.io/traptitech/${{ matrix.component }}:buildcache

build-dashboard-image:
name: Build Dashboard Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set APP_VERSION env
run: echo "APP_VERSION=$(echo ${GITHUB_REF:11})" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: traptitech
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: docker/build-push-action@v4
with:
context: dashboard
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/traptitech/ns-dashboard:latest
ghcr.io/traptitech/ns-dashboard:${{ env.APP_VERSION }}
cache-from: type=registry,ref=ghcr.io/traptitech/ns-dashboard:buildcache

release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Release
uses: softprops/action-gh-release@v1

0 comments on commit 13b0b6b

Please sign in to comment.