-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 changed file
with
102 additions
and
0 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,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 |