Skip to content

Commit

Permalink
Merge pull request #93 from niladrih/ci
Browse files Browse the repository at this point in the history
fix(ci): update github actions and OS to ubuntu-latest
  • Loading branch information
niladrih authored Jul 25, 2023
2 parents 6d3db16 + 83778ca commit 316bbd2
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 59 deletions.
54 changes: 26 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Shellcheck
uses: reviewdog/action-shellcheck@v1
Expand All @@ -45,10 +45,10 @@ jobs:
test:
# to ignore tests on release
if: ${{ (github.event.ref_type != 'tag') }}
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set Branch
run: |
Expand All @@ -74,7 +74,7 @@ jobs:
needs: ['lint', 'test']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
Expand All @@ -85,7 +85,7 @@ jobs:
- name: Set Build Date
id: date
run: |
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')"
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT
- name: Set tag
run: |
Expand All @@ -99,25 +99,24 @@ jobs:
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
# add each registry to which the image needs to be pushed here
images: |
${{ env.IMAGE_ORG }}/cstor-base
quay.io/${{ env.IMAGE_ORG }}/cstor-base
ghcr.io/${{ env.IMAGE_ORG }}/cstor-base
tag-latest: false
tag-custom-only: true
tag-custom: |
${{ env.TAG }}
tags: |
type=raw,value=latest,enable=false
type=raw,value=${{ env.IMAGE_TAG }}
- name: Print Tag info
run: |
echo "BRANCH: ${BRANCH}"
echo "${{ steps.docker_meta.outputs.tags }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all

Expand All @@ -133,27 +132,27 @@ jobs:
version: v0.5.1

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/cstor-base.Dockerfile
Expand All @@ -173,7 +172,7 @@ jobs:
needs: ['lint', 'cstor-base']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
Expand All @@ -184,7 +183,7 @@ jobs:
- name: Set Build Date
id: date
run: |
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')"
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT
- name: Set tag
run: |
Expand All @@ -198,56 +197,55 @@ jobs:
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
# add each registry to which the image needs to be pushed here
images: |
${{ env.IMAGE_ORG }}/cstor-pool
quay.io/${{ env.IMAGE_ORG }}/cstor-pool
ghcr.io/${{ env.IMAGE_ORG }}/cstor-pool
tag-latest: false
tag-custom-only: true
tag-custom: |
${{ env.TAG }}
tags: |
type=raw,value=latest,enable=false
type=raw,value=${{ env.IMAGE_TAG }}
- name: Print Tag info
run: |
echo "BRANCH: ${BRANCH}"
echo "${{ steps.docker_meta.outputs.tags }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/cstor.Dockerfile
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Shellcheck
uses: reviewdog/action-shellcheck@v1
Expand All @@ -42,10 +42,10 @@ jobs:
pattern: '*.sh'

test:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set Branch
run: |
Expand All @@ -72,10 +72,10 @@ jobs:
needs: ['lint']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all

Expand All @@ -86,12 +86,12 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Build Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/cstor-base.Dockerfile
Expand Down
Loading

0 comments on commit 316bbd2

Please sign in to comment.