Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
ignore github yaml files
Browse files Browse the repository at this point in the history
Signed-off-by: Nitesh Balusu <[email protected]>
  • Loading branch information
niteshbalusu11 committed Jan 31, 2023
1 parent ff22aa8 commit f0cfd72
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/on-push-github.ignore
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" ./
47 changes: 47 additions & 0 deletions .github/workflows/on-tag-github.ignore
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" ./

0 comments on commit f0cfd72

Please sign in to comment.