-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action to publish release (#85)
- Loading branch information
Showing
3 changed files
with
145 additions
and
35 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,61 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
# permissions are needed if pushing to ghcr.io | ||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
install: | ||
name: Test installation | ||
runs-on: ubuntu-latest-m | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Desktop | ||
id: start_desktop | ||
uses: docker/desktop-action/start@v0.3.1 | ||
|
||
- name: Validate metadata | ||
run: docker extension validate ./metadata.json | ||
|
||
- name: Build extension | ||
run: docker build -t digma-docker-extension . | ||
|
||
- name: Install extension | ||
run: docker extension install digma-docker-extension -f | ||
|
||
build: | ||
name: Build | ||
needs: [install] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build multi-platform image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: false |
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,79 @@ | ||
name: Publish release | ||
|
||
# Controls when the workflow will run | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
|
||
# permissions are needed if pushing to ghcr.io | ||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
install: | ||
name: Test the installation | ||
runs-on: ubuntu-latest-m | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Desktop | ||
id: start_desktop | ||
uses: docker/desktop-action/start@v0.3.1 | ||
|
||
- name: Validate metadata | ||
run: docker extension validate ./metadata.json | ||
|
||
- name: Build extension | ||
run: docker build -t digma-docker-extension . | ||
|
||
- name: Install extension | ||
run: docker extension install digma-docker-extension -f | ||
|
||
build-and-push: | ||
name: Build and push to the DockerHub | ||
needs: [install] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: metadata # you'll use this in the next step | ||
uses: docker/metadata-action@v4 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: digmaai/digma-docker-extension | ||
# Docker tags based on the following events/attributes | ||
tags: | | ||
type=semver,pattern={{version}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} |
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