This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nitesh Balusu <[email protected]>
- Loading branch information
1 parent
ff22aa8
commit f0cfd72
Showing
2 changed files
with
99 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,52 @@ | ||
name: Build on push | ||
|
||
permissions: | ||
packages: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.yml' | ||
- '**/*.yaml' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
|
||
jobs: | ||
build: | ||
name: Build image | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set env variables | ||
run: | | ||
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_ENV | ||
IMAGE_NAME="${GITHUB_REPOSITORY#*/}" | ||
echo "IMAGE_NAME=${IMAGE_NAME//docker-/}" >> $GITHUB_ENV | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
id: qemu | ||
|
||
- name: Setup Docker buildx action | ||
uses: docker/setup-buildx-action@v2 | ||
id: buildx | ||
|
||
- name: Run Docker buildx | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64 \ | ||
--tag ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$BRANCH \ | ||
--output "type=registry" ./ |
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,47 @@ | ||
name: Build on tag | ||
|
||
permissions: | ||
packages: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
- v[0-9]+.[0-9]+.[0-9]+-* | ||
|
||
jobs: | ||
build: | ||
name: Build image | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set env variables | ||
run: | | ||
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
IMAGE_NAME="${GITHUB_REPOSITORY#*/}" | ||
echo "IMAGE_NAME=${IMAGE_NAME//docker-/}" >> $GITHUB_ENV | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
id: qemu | ||
|
||
- name: Setup Docker buildx action | ||
uses: docker/setup-buildx-action@v2 | ||
id: buildx | ||
|
||
- name: Run Docker buildx | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64 \ | ||
--tag ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$TAG \ | ||
--output "type=registry" ./ |